【发布时间】:2020-02-03 08:57:32
【问题描述】:
我要做的是在 Code First 中为这个基本实体实现模型:
public class CompanyType{
public int Id {get;set;}
public string CompanyType {get;set;}
}
public class Company{
public int Id {get;set;}
public string Company {get;set;}
public string idCompanyType {get;set;} //Related 1-1 to CompanyType
}
public class Employee{
public int Id {get;set;}
public string Company {get;set;}
public int idCompany {get;set;} // --> Here I have to relate idCompany with CompanyId ( 1 company , N Employee
}
问题是:
- 在 Code First 中实现关系的正确方法是什么?
- 由于我要实现的应用程序的数据库会非常大,在SqlServer中设计数据库然后继续搭建表的好方法吗?
感谢支持
【问题讨论】:
标签: c# .net-core entity-framework-6 entity-framework-core