From 2451ab9dff4029c461327817c11bac006a231c63 Mon Sep 17 00:00:00 2001 From: Robert Raboud Date: Tue, 30 Jan 2018 08:16:20 -0500 Subject: [PATCH] Changed AddRange to AddRangeAwait --- .../Catalog.API/Infrastructure/CatalogContextSeed.cs | 6 +++--- .../Identity/Identity.API/Data/ApplicationDbContextSeed.cs | 2 +- .../Identity.API/Data/ConfigurationDbContextSeed.cs | 6 +++--- .../Marketing.API/Infrastructure/MarketingContextSeed.cs | 2 +- .../Ordering.API/Infrastructure/OrderingContextSeed.cs | 4 ++-- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/Services/Catalog/Catalog.API/Infrastructure/CatalogContextSeed.cs b/src/Services/Catalog/Catalog.API/Infrastructure/CatalogContextSeed.cs index 42ac7b740..712719e23 100644 --- a/src/Services/Catalog/Catalog.API/Infrastructure/CatalogContextSeed.cs +++ b/src/Services/Catalog/Catalog.API/Infrastructure/CatalogContextSeed.cs @@ -30,7 +30,7 @@ if (!context.CatalogBrands.Any()) { - context.CatalogBrands.AddRange(useCustomizationData + await context.CatalogBrands.AddRangeAsync(useCustomizationData ? GetCatalogBrandsFromFile(contentRootPath, logger) : GetPreconfiguredCatalogBrands()); @@ -39,7 +39,7 @@ if (!context.CatalogTypes.Any()) { - context.CatalogTypes.AddRange(useCustomizationData + await context.CatalogTypes.AddRangeAsync(useCustomizationData ? GetCatalogTypesFromFile(contentRootPath, logger) : GetPreconfiguredCatalogTypes()); @@ -48,7 +48,7 @@ if (!context.CatalogItems.Any()) { - context.CatalogItems.AddRange(useCustomizationData + await context.CatalogItems.AddRangeAsync(useCustomizationData ? GetCatalogItemsFromFile(contentRootPath, context, logger) : GetPreconfiguredItems()); diff --git a/src/Services/Identity/Identity.API/Data/ApplicationDbContextSeed.cs b/src/Services/Identity/Identity.API/Data/ApplicationDbContextSeed.cs index 3dbf28171..058c58dbc 100644 --- a/src/Services/Identity/Identity.API/Data/ApplicationDbContextSeed.cs +++ b/src/Services/Identity/Identity.API/Data/ApplicationDbContextSeed.cs @@ -33,7 +33,7 @@ namespace Microsoft.eShopOnContainers.Services.Identity.API.Data if (!context.Users.Any()) { - context.Users.AddRange(useCustomizationData + await context.Users.AddRangeAsync(useCustomizationData ? GetUsersFromFile(contentRootPath, logger) : GetDefaultUser()); diff --git a/src/Services/Identity/Identity.API/Data/ConfigurationDbContextSeed.cs b/src/Services/Identity/Identity.API/Data/ConfigurationDbContextSeed.cs index b109bf896..db43c6019 100644 --- a/src/Services/Identity/Identity.API/Data/ConfigurationDbContextSeed.cs +++ b/src/Services/Identity/Identity.API/Data/ConfigurationDbContextSeed.cs @@ -27,17 +27,17 @@ namespace Microsoft.eShopOnContainers.Services.Identity.API.Data if (!await context.Clients.AnyAsync()) { - context.Clients.AddRange(Config.GetClients(clientUrls).Select(client => client.ToEntity())); + await context.Clients.AddRangeAsync(Config.GetClients(clientUrls).Select(client => client.ToEntity())); } if (!await context.IdentityResources.AnyAsync()) { - context.IdentityResources.AddRange(Config.GetResources().Select(resource => resource.ToEntity())); + await context.IdentityResources.AddRangeAsync(Config.GetResources().Select(resource => resource.ToEntity())); } if (!await context.ApiResources.AnyAsync()) { - context.ApiResources.AddRange(Config.GetApis().Select(api => api.ToEntity())); + await context.ApiResources.AddRangeAsync(Config.GetApis().Select(api => api.ToEntity())); } await context.SaveChangesAsync(); diff --git a/src/Services/Marketing/Marketing.API/Infrastructure/MarketingContextSeed.cs b/src/Services/Marketing/Marketing.API/Infrastructure/MarketingContextSeed.cs index 6396d3f5d..c42b1975e 100644 --- a/src/Services/Marketing/Marketing.API/Infrastructure/MarketingContextSeed.cs +++ b/src/Services/Marketing/Marketing.API/Infrastructure/MarketingContextSeed.cs @@ -19,7 +19,7 @@ { if (!context.Campaigns.Any()) { - context.Campaigns.AddRange( + await context.Campaigns.AddRangeAsync( GetPreconfiguredMarketings()); await context.SaveChangesAsync(); diff --git a/src/Services/Ordering/Ordering.API/Infrastructure/OrderingContextSeed.cs b/src/Services/Ordering/Ordering.API/Infrastructure/OrderingContextSeed.cs index 53c53f052..4f3f0b0f2 100644 --- a/src/Services/Ordering/Ordering.API/Infrastructure/OrderingContextSeed.cs +++ b/src/Services/Ordering/Ordering.API/Infrastructure/OrderingContextSeed.cs @@ -39,7 +39,7 @@ if (!context.CardTypes.Any()) { - context.CardTypes.AddRange(useCustomizationData + await context.CardTypes.AddRangeAsync(useCustomizationData ? GetCardTypesFromFile(contentRootPath, logger) : GetPredefinedCardTypes()); @@ -48,7 +48,7 @@ if (!context.OrderStatus.Any()) { - context.OrderStatus.AddRange(useCustomizationData + await context.OrderStatus.AddRangeAsync(useCustomizationData ? GetOrderStatusFromFile(contentRootPath, logger) : GetPredefinedOrderStatus()); }