Is there a difference between services.AddDbContext
and services.AddEntityFramework().AddDbContext
? They booth looks to be valid under core-1.0.0.
Choice A
services.AddDbContext<DbContext>(options => options.UseSqlServer(connection));
Choice B
services.AddEntityFramework()
.AddDbContext<DbContext>(options =>
options.UseSqlServer(connection));
Also noticed that .AddSqlServer()
looks to be gone. Last time I did some work on core was RC2 and I see that a lot has been cleaned/renamed/simplified, I guess that's nice.
I'm quoting: You only need to use this functionality (AddEntityFramework) when you want Entity Framework to resolve the services it uses from an external IServiceProvider. If you are not using an external IServiceProvider, Entity Framework will take care of creating the services it requires.
I'm quoting: Intentionally in this namespace since this is for use by other relational providers rather than by top-level app developers.