Changed AddRange to AddRangeAwait
This commit is contained in:
parent
d1c5eb7a19
commit
2451ab9dff
@ -30,7 +30,7 @@
|
|||||||
|
|
||||||
if (!context.CatalogBrands.Any())
|
if (!context.CatalogBrands.Any())
|
||||||
{
|
{
|
||||||
context.CatalogBrands.AddRange(useCustomizationData
|
await context.CatalogBrands.AddRangeAsync(useCustomizationData
|
||||||
? GetCatalogBrandsFromFile(contentRootPath, logger)
|
? GetCatalogBrandsFromFile(contentRootPath, logger)
|
||||||
: GetPreconfiguredCatalogBrands());
|
: GetPreconfiguredCatalogBrands());
|
||||||
|
|
||||||
@ -39,7 +39,7 @@
|
|||||||
|
|
||||||
if (!context.CatalogTypes.Any())
|
if (!context.CatalogTypes.Any())
|
||||||
{
|
{
|
||||||
context.CatalogTypes.AddRange(useCustomizationData
|
await context.CatalogTypes.AddRangeAsync(useCustomizationData
|
||||||
? GetCatalogTypesFromFile(contentRootPath, logger)
|
? GetCatalogTypesFromFile(contentRootPath, logger)
|
||||||
: GetPreconfiguredCatalogTypes());
|
: GetPreconfiguredCatalogTypes());
|
||||||
|
|
||||||
@ -48,7 +48,7 @@
|
|||||||
|
|
||||||
if (!context.CatalogItems.Any())
|
if (!context.CatalogItems.Any())
|
||||||
{
|
{
|
||||||
context.CatalogItems.AddRange(useCustomizationData
|
await context.CatalogItems.AddRangeAsync(useCustomizationData
|
||||||
? GetCatalogItemsFromFile(contentRootPath, context, logger)
|
? GetCatalogItemsFromFile(contentRootPath, context, logger)
|
||||||
: GetPreconfiguredItems());
|
: GetPreconfiguredItems());
|
||||||
|
|
||||||
|
@ -33,7 +33,7 @@ namespace Microsoft.eShopOnContainers.Services.Identity.API.Data
|
|||||||
|
|
||||||
if (!context.Users.Any())
|
if (!context.Users.Any())
|
||||||
{
|
{
|
||||||
context.Users.AddRange(useCustomizationData
|
await context.Users.AddRangeAsync(useCustomizationData
|
||||||
? GetUsersFromFile(contentRootPath, logger)
|
? GetUsersFromFile(contentRootPath, logger)
|
||||||
: GetDefaultUser());
|
: GetDefaultUser());
|
||||||
|
|
||||||
|
@ -27,17 +27,17 @@ namespace Microsoft.eShopOnContainers.Services.Identity.API.Data
|
|||||||
|
|
||||||
if (!await context.Clients.AnyAsync())
|
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())
|
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())
|
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();
|
await context.SaveChangesAsync();
|
||||||
|
@ -19,7 +19,7 @@
|
|||||||
{
|
{
|
||||||
if (!context.Campaigns.Any())
|
if (!context.Campaigns.Any())
|
||||||
{
|
{
|
||||||
context.Campaigns.AddRange(
|
await context.Campaigns.AddRangeAsync(
|
||||||
GetPreconfiguredMarketings());
|
GetPreconfiguredMarketings());
|
||||||
|
|
||||||
await context.SaveChangesAsync();
|
await context.SaveChangesAsync();
|
||||||
|
@ -39,7 +39,7 @@
|
|||||||
|
|
||||||
if (!context.CardTypes.Any())
|
if (!context.CardTypes.Any())
|
||||||
{
|
{
|
||||||
context.CardTypes.AddRange(useCustomizationData
|
await context.CardTypes.AddRangeAsync(useCustomizationData
|
||||||
? GetCardTypesFromFile(contentRootPath, logger)
|
? GetCardTypesFromFile(contentRootPath, logger)
|
||||||
: GetPredefinedCardTypes());
|
: GetPredefinedCardTypes());
|
||||||
|
|
||||||
@ -48,7 +48,7 @@
|
|||||||
|
|
||||||
if (!context.OrderStatus.Any())
|
if (!context.OrderStatus.Any())
|
||||||
{
|
{
|
||||||
context.OrderStatus.AddRange(useCustomizationData
|
await context.OrderStatus.AddRangeAsync(useCustomizationData
|
||||||
? GetOrderStatusFromFile(contentRootPath, logger)
|
? GetOrderStatusFromFile(contentRootPath, logger)
|
||||||
: GetPredefinedOrderStatus());
|
: GetPredefinedOrderStatus());
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user