I have two Models RulePeriod and RulePeriodTime, as follows:
[Table("rule_period")]
public class RulePeriod {
[Key]
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
public int id { get; set; }
public int ruleId { get; set; }
public int type { get; set; }
public DateTime start { get; set; }
public DateTime finish { get; set; }
public Rule rule { get; set; }
public IEnumerable<RulePeriodTime> rulePeriodTimes { get; set; }
}
[Table("rule_period_time")]
public class RulePeriodTime {
[Key]
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
public int id { get; set; }
public int rulePeriodId { get; set; }
public int day { get; set; }
public DateTime start { get; set; }
public DateTime finish { get; set; }
public RulePeriod rulePeriod { get; set; }
}
Radzen, however, cannot automatically identify the 'rulePeriodTimes' type in the RulePeriod class:
Is this your project that uses models defined outside of Radzen? I think we already discussed that we don't support those cases. If not - we will need a sample project.
It was, now I'm running a pre-build script to copy all the models from the external reference into the Radzen project. All the problems I had before related to this issue were solved, since the models are now inside the project.
[Table("rule")]
public class Rule {
[Key]
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
public int id { get; set; }
[MaxLength(100)]
public string name { get; set; }
public IEnumerable<RulePoint> rulePoints { get; set; }
public IEnumerable<RulePeriod> rulePeriods { get; set; }
public IEnumerable<PersonRule> personRules { get; set; }
public IEnumerable<VehicleRule> vehicleRules { get; set; }
}