What I'm trying to do is implementing the model in Code First for this basic entities:
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
}
Questions are:
- What is the correct way to implement the relations in Code First ?
- Since the database of the application I have to realize will be very big, Can be a good approach designing the database in SqlServer and then proceed to scaffold the tables ?
Thanks to support