I want to use EF the Code Firts environment, I see on the web that there are two ways a simple one that only creates the DbSet runs and the database is created.
public class CompanyContext : DbContext
{
public CompanyContext() : base("CompanyDatabase") { }
public DbSet<Collaborator> Collaborators { get; set; }
public DbSet<Department> Departments { get; set; }
public DbSet<Manager> Managers { get; set; }
}
But I've also seen that a class is created with the terminology at the end Map as ManagerMap.
public SeccionMap()
{
ToTable("Secciones");
HasKey(c => c.SeccionId);
}
Both create the database, but I think the second option is the most appropriate ?, You see that you have more control of what you want to do.
Someone can pass me a tutorial or link of the second option to use the code firts approach.