I'm new to Entity Framework, and I have an existing database that I'd like to add a few tables to, rather than creating a database from scratch for my new tables. Is this possible with Entity Framework?
I've looked through the following MSDN articles on Code First development, and haven't been able to find the answer to my issue:
I have had the same experience with my asp.net mvc3 project, it's a little different from asp.net but I guess entity framework is the focus here.
create new table in sql server
create corresponding model in your model project
Add the new table object property in DbNameEntities.cs
public DbSet NewTables { get; set; }
In Application_Start() method, comment out the original code first approach
System.Data.Entity.Database.SetInitializer(new SeedSampleData());
replace with this:
System.Data.Entity.Database.SetInitializer<DbNameEntities>(null);
Yes, this is certainly possible.
A decent walk-through is available on Scott Gu's blog
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.