I have some old tables which I have added them to the project by reverse engineering to use them as code first.
Something like this:
public class User
{
public string Name { get; set; }
public int Id { get; set; }
}
public class Profile
{
[Key, ForeignKey("User")]
public int Id { get; set; }
public string Name { get; set; }
public virtual User User { get; set; }
}
public class EFDbContext : DbContext
{
public DbSet<User> Users{ get; set; }
public DbSet<Profile> Profiles { get; set; }
}
Here if my old table User was exist then Entity Framework doesn't create other tables such as Profile table.
My Question How can I specify which table should be created if doesn't exist?