Stop passing IConfiguration to AddEntityFramework

This commit is contained in:
ajcvickers 2015-03-20 14:25:25 -07:00
parent 7e3db8935e
commit a76b6cac24
5 changed files with 9 additions and 9 deletions

View File

@ -33,13 +33,13 @@ namespace MusicStore
// Add EF services to the services container // Add EF services to the services container
if (useInMemoryStore) if (useInMemoryStore)
{ {
services.AddEntityFramework(Configuration) services.AddEntityFramework()
.AddInMemoryStore() .AddInMemoryStore()
.AddDbContext<MusicStoreContext>(); .AddDbContext<MusicStoreContext>();
} }
else else
{ {
services.AddEntityFramework(Configuration) services.AddEntityFramework()
.AddSqlServer() .AddSqlServer()
.AddDbContext<MusicStoreContext>(); .AddDbContext<MusicStoreContext>();
} }

View File

@ -44,7 +44,7 @@ namespace MusicStore
public void ConfigureServices(IServiceCollection services) public void ConfigureServices(IServiceCollection services)
{ {
// Add EF services to the services container // Add EF services to the services container
services.AddEntityFramework(Configuration) services.AddEntityFramework()
.AddSqlServer() .AddSqlServer()
.AddDbContext<MusicStoreContext>(); .AddDbContext<MusicStoreContext>();

View File

@ -46,13 +46,13 @@ namespace MusicStore
// Add EF services to the services container // Add EF services to the services container
if (useInMemoryStore) if (useInMemoryStore)
{ {
services.AddEntityFramework(Configuration) services.AddEntityFramework()
.AddInMemoryStore() .AddInMemoryStore()
.AddDbContext<MusicStoreContext>(); .AddDbContext<MusicStoreContext>();
} }
else else
{ {
services.AddEntityFramework(Configuration) services.AddEntityFramework()
.AddSqlServer() .AddSqlServer()
.AddDbContext<MusicStoreContext>(); .AddDbContext<MusicStoreContext>();
} }

View File

@ -36,13 +36,13 @@ namespace MusicStore
// Add EF services to the services container // Add EF services to the services container
if (useInMemoryStore) if (useInMemoryStore)
{ {
services.AddEntityFramework(Configuration) services.AddEntityFramework()
.AddInMemoryStore() .AddInMemoryStore()
.AddDbContext<MusicStoreContext>(); .AddDbContext<MusicStoreContext>();
} }
else else
{ {
services.AddEntityFramework(Configuration) services.AddEntityFramework()
.AddSqlServer() .AddSqlServer()
.AddDbContext<MusicStoreContext>(); .AddDbContext<MusicStoreContext>();
} }

View File

@ -53,13 +53,13 @@ namespace MusicStore
// Add EF services to the services container // Add EF services to the services container
if (useInMemoryStore) if (useInMemoryStore)
{ {
services.AddEntityFramework(Configuration) services.AddEntityFramework()
.AddInMemoryStore() .AddInMemoryStore()
.AddDbContext<MusicStoreContext>(); .AddDbContext<MusicStoreContext>();
} }
else else
{ {
services.AddEntityFramework(Configuration) services.AddEntityFramework()
.AddSqlServer() .AddSqlServer()
.AddDbContext<MusicStoreContext>(); .AddDbContext<MusicStoreContext>();
} }