@manhng

Welcome to my blog!

EF7

July 18, 2017 18:15

EF Core

Entity Framework Core Tutorial

http://www.dotnetcurry.com/entityframework/1347/entity-framework-ef-core-tutorial

https://github.com/dotnetcurry/ef-core-tutorial

Using EF Core in ASP.NET Core Web API for performing CRUD operations

http://www.dotnetcurry.com/entityframework/1348/ef-core-web-api-crud-operations

https://github.com/dotnetcurry/efcore-asp.net-core-crud

webapi-efcore-architecture

Microsoft's websites

https://msdn.microsoft.com/en-us/library/jj591621(v=vs.113).aspx

 

https://msdn.microsoft.com/en-us/library/jj193542(v=vs.113).aspx

 

https://docs.microsoft.com/en-us/aspnet/mvc/overview/getting-started/getting-started-with-ef-using-mvc/migrations-and-deployment-with-the-entity-framework-in-an-asp-net-mvc-application

https://code.msdn.microsoft.com/ASPNET-MVC-Application-b01a9fe8

 

EF7

http://coderhints.com/ef7-seed-user/

 

Some EF7 demo applications

https://github.com/rowanmiller/Demo-EF7

 

Data Points - Looking Ahead to Entity Framework 7

https://msdn.microsoft.com/magazine/dn890367.aspx

 

Data Points - EF6 Code First Migrations for Multiple Models

https://msdn.microsoft.com/magazine/dn948104.aspx

 

Data Points - The EF6, EF7 and ASP.NET 5 Soup - 2015

https://msdn.microsoft.com/magazine/dn973011.aspx

 

Entity Framework Core and sqlite: database migration (using VS2017 macOS)

https://medium.com/@yostane/entity-framework-core-and-sqlite-database-migration-using-vs2017-macos-28812c64e7ef

 

Entity Framework 7 Code First Migrations

https://dotnetthoughts.net/entity-framework-7-code-first-migrations/

https://dotnetthoughts.net/entity-framework-7-code-first-migrations/

 

Fix for Entity Framework 7 Migration Problem in Shawn Wildermuth’s ASP.NET 5 Pluralsight Sourse

Shawn Wildermuth posted a great ASP.NET 5 course up at Pluralsight here.

This post is a quick fix to a problem I ran into updating the database in the ASP.NET Identity Section. Note – I have been using the RC1-Final version of ASP.NET 5.

When you try to run the project so that it migrates the identity schema into the database, migration fails. The reason is that originally the database was created in the `Startup.cs` class with a call to:

db.Database.EnsureCreated()

This will prevent migrations from working because it doesn’t (by design) create the necessary system generated __EFMigrationsHistory table in the DB. If you change this line of code to:

db.Database.Migrate();

then everything works (at least for me) because with this code, when the database is first created the migrations table will be added. Note you will need to have created the database via this method in the first place – you can’t add/change this line of code after the DB is already created as the migrations table can’t be added retrospectively. If this is where you are, you have no easy option but to drop and recreate the DB. Also, you will need to manually add samhastings as the username in the two existing Trips in the DB, since the migration code doesn’t account for this.

Julie Lerman posted on this in a lot more detail here. Hope this helps!

Categories

Recent posts