I have two classes:
Main class:
public class CCourseDetailModel
{
[Key]
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
public int CourseDetailId { get; set; }
[ForeignKey("CourseOutcomes")]
public int CourseOutcomesId { get; set; }
public virtual CACourseOutcomesModel CourseOutcomes { get; set; }
}
Dependent class:
public class CACourseOutcomesModel
{
[Key, ForeignKey("CourseDetail")]
public int CourseOutcomesId { get; set; }
[Required]
public virtual CCourseDetailModel CourseDetail { get; set; }
}
I have 10 or so similar classes, with 1 to 1 relationships that work fine. This is the only one giving me the following error:
CACourseOutcomesModel_CourseDetail_Target: : Multiplicity is not valid in Role 'CACourseOutcomesModel_CourseDetail_Target' in relationship 'CACourseOutcomesModel_CourseDetail'. Because the Dependent Role properties are not the key properties, the upper bound of the multiplicity of the Dependent Role must be ''.*
Any idea where I'm going wrong? Need a fresh set of eyes please. Thanks!