[ForeignKey("WardId")]
indicates that the property to use as a foreign key to the Ward table should be the WardId
property on the BioSheetModel
class.
You're getting the error because you haven't defined a WardId
property on the BioSheetModel
class.
Add
public int WardId {get; set;}
for a non-nullable/required relationship, or
public int? WardId {get; set;}
for a nullable/optional relationship.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…