Well this may be a silly question but I would like to know how other people who use this framework work. I am new using these technologies, I am using Visual Studio with ASP.NET MVC 5 and Entity Framework and I have just started a new project, I am with the creation of the database by code first, I have for example two models Father and Son
Father.cs
public class Padre
{
public int ID { get; set; }
public string Nombre { get; set; }
public int Edad { get; set; }
}
public class PruebaDBContext : DbContext
{
public System.Data.Entity.DbSet<Pruebas.Models.Padre> Padres { get; set; }
public System.Data.Entity.DbSet<Pruebas.Models.Hijo> Hijos { get; set; }
}
I have the model of Hijo.cs , my questions would be:
1- It would be nice to put my DbSets in a class of the model (As I have it in the example) or you should put it all together in another specific class to create the tables (In a separate file).
2-Can I place the DbSets anywhere other than in my TestDBContext class without having to use DbContext again but not create another database?