namespace Healthcare
{
public class Doc
{
public int DocId { get; set; }
public string DocName { get; set; }
public string Street { get; set; }
public int Number { get; set; }
public string Zip { get; set; }
public string Place { get; set; }
public List<DocContract> DocContract { get; set; }
}
public class DocContract
{
public int DocId { get; set; }
public string Date { get; set; }
public Doc Doc { get; set; }
}
}
Whenever I try to enable migrations Im getting the following error:
Healthcare.DocContract: : EntityType 'DocContract' has no key defined. Define the key for this EntityType.
How can I solve this error? Basically every doc has one contract