Making AddRange async (#399)
This commit is contained in:
@@ -19,7 +19,7 @@ namespace Microsoft.eShopWeb.Infrastructure.Data
|
|||||||
// context.Database.Migrate();
|
// context.Database.Migrate();
|
||||||
if (!await catalogContext.CatalogBrands.AnyAsync())
|
if (!await catalogContext.CatalogBrands.AnyAsync())
|
||||||
{
|
{
|
||||||
catalogContext.CatalogBrands.AddRange(
|
await catalogContext.CatalogBrands.AddRangeAsync(
|
||||||
GetPreconfiguredCatalogBrands());
|
GetPreconfiguredCatalogBrands());
|
||||||
|
|
||||||
await catalogContext.SaveChangesAsync();
|
await catalogContext.SaveChangesAsync();
|
||||||
@@ -27,7 +27,7 @@ namespace Microsoft.eShopWeb.Infrastructure.Data
|
|||||||
|
|
||||||
if (!await catalogContext.CatalogTypes.AnyAsync())
|
if (!await catalogContext.CatalogTypes.AnyAsync())
|
||||||
{
|
{
|
||||||
catalogContext.CatalogTypes.AddRange(
|
await catalogContext.CatalogTypes.AddRangeAsync(
|
||||||
GetPreconfiguredCatalogTypes());
|
GetPreconfiguredCatalogTypes());
|
||||||
|
|
||||||
await catalogContext.SaveChangesAsync();
|
await catalogContext.SaveChangesAsync();
|
||||||
@@ -35,7 +35,7 @@ namespace Microsoft.eShopWeb.Infrastructure.Data
|
|||||||
|
|
||||||
if (!await catalogContext.CatalogItems.AnyAsync())
|
if (!await catalogContext.CatalogItems.AnyAsync())
|
||||||
{
|
{
|
||||||
catalogContext.CatalogItems.AddRange(
|
await catalogContext.CatalogItems.AddRangeAsync(
|
||||||
GetPreconfiguredItems());
|
GetPreconfiguredItems());
|
||||||
|
|
||||||
await catalogContext.SaveChangesAsync();
|
await catalogContext.SaveChangesAsync();
|
||||||
|
|||||||
Reference in New Issue
Block a user