Making "any" async (#397)

* Making "any" async

* Removed unused using

Co-authored-by: Eric Fleming <eric-fleming18@hotmail.com>
This commit is contained in:
yigith
2020-06-15 20:07:15 +03:00
committed by GitHub
parent 18589f9a73
commit 623ec49ed7

View File

@@ -1,8 +1,8 @@
using Microsoft.eShopWeb.ApplicationCore.Entities;
using Microsoft.EntityFrameworkCore;
using Microsoft.eShopWeb.ApplicationCore.Entities;
using Microsoft.Extensions.Logging;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
namespace Microsoft.eShopWeb.Infrastructure.Data
@@ -17,8 +17,7 @@ namespace Microsoft.eShopWeb.Infrastructure.Data
{
// TODO: Only run this if using a real database
// context.Database.Migrate();
if (!catalogContext.CatalogBrands.Any())
if (!await catalogContext.CatalogBrands.AnyAsync())
{
catalogContext.CatalogBrands.AddRange(
GetPreconfiguredCatalogBrands());
@@ -26,7 +25,7 @@ namespace Microsoft.eShopWeb.Infrastructure.Data
await catalogContext.SaveChangesAsync();
}
if (!catalogContext.CatalogTypes.Any())
if (!await catalogContext.CatalogTypes.AnyAsync())
{
catalogContext.CatalogTypes.AddRange(
GetPreconfiguredCatalogTypes());
@@ -34,7 +33,7 @@ namespace Microsoft.eShopWeb.Infrastructure.Data
await catalogContext.SaveChangesAsync();
}
if (!catalogContext.CatalogItems.Any())
if (!await catalogContext.CatalogItems.AnyAsync())
{
catalogContext.CatalogItems.AddRange(
GetPreconfiguredItems());