Changed AddRange to AddRangeAwait

This commit is contained in:
Robert Raboud 2018-01-30 08:16:20 -05:00
parent d1c5eb7a19
commit 2451ab9dff
5 changed files with 10 additions and 10 deletions

View File

@ -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());

View File

@ -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());

View File

@ -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();

View File

@ -19,7 +19,7 @@
{
if (!context.Campaigns.Any())
{
context.Campaigns.AddRange(
await context.Campaigns.AddRangeAsync(
GetPreconfiguredMarketings());
await context.SaveChangesAsync();

View File

@ -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());
}