I have a Person model which represents different aspects of a person. In my person model I have the following:
public class PersonsContext : DbContext
{
public PersonsContext()
: base("SiteDBCon")
{
}
public DbSet<Person> Persons { get; set; }
public DbSet<UserProfile> UserProfiles { get; set; }
}
public class Person
{
public int ID { get; set; }
public int Age { get; set; }
public string Gender { get; set; }
public string Race { get; set; }
public string Ethnicity { get; set; }
public int UserId { get; set; } //User who input data
public UserProfile UserProfile { get; set; } //User who input data
}
However, there are some things that a person can have multiple entries for, address - current previous, Phone numbers current previous etc.. All of which I want in separate tables. Can I add those tables in the PersonModel or do I need to create a new Model for each table, eg. AddressModel, PhoneModel? They will all have a one to many relationship with the Person table. If you can do it is it a good idea to have all in one Model. In the past I have created separate models but I am questioning if that is necessary.