Stop passing IConfiguration to AddEntityFramework
This commit is contained in:
parent
7e3db8935e
commit
a76b6cac24
|
|
@ -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>();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -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>();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -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>();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -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>();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -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>();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue