Browse Source
Merge pull request #262 from Wkalmar/master
Remove blocking call from main
main
Eric Fleming
7 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with
5 additions and
4 deletions
-
src/Web/Program.cs
-
src/Web/Web.csproj
|
|
@ -6,12 +6,13 @@ using Microsoft.eShopWeb.Infrastructure.Identity; |
|
|
using Microsoft.Extensions.DependencyInjection; |
|
|
using Microsoft.Extensions.DependencyInjection; |
|
|
using Microsoft.Extensions.Logging; |
|
|
using Microsoft.Extensions.Logging; |
|
|
using System; |
|
|
using System; |
|
|
|
|
|
using System.Threading.Tasks; |
|
|
|
|
|
|
|
|
namespace Microsoft.eShopWeb.Web |
|
|
namespace Microsoft.eShopWeb.Web |
|
|
{ |
|
|
{ |
|
|
public class Program |
|
|
public class Program |
|
|
{ |
|
|
{ |
|
|
public static void Main(string[] args) |
|
|
public async static Task Main(string[] args) |
|
|
{ |
|
|
{ |
|
|
var host = CreateWebHostBuilder(args) |
|
|
var host = CreateWebHostBuilder(args) |
|
|
.Build(); |
|
|
.Build(); |
|
|
@ -23,11 +24,10 @@ namespace Microsoft.eShopWeb.Web |
|
|
try |
|
|
try |
|
|
{ |
|
|
{ |
|
|
var catalogContext = services.GetRequiredService<CatalogContext>(); |
|
|
var catalogContext = services.GetRequiredService<CatalogContext>(); |
|
|
CatalogContextSeed.SeedAsync(catalogContext, loggerFactory) |
|
|
await CatalogContextSeed.SeedAsync(catalogContext, loggerFactory); |
|
|
.Wait(); |
|
|
|
|
|
|
|
|
|
|
|
var userManager = services.GetRequiredService<UserManager<ApplicationUser>>(); |
|
|
var userManager = services.GetRequiredService<UserManager<ApplicationUser>>(); |
|
|
AppIdentityDbContextSeed.SeedAsync(userManager).Wait(); |
|
|
await AppIdentityDbContextSeed.SeedAsync(userManager); |
|
|
} |
|
|
} |
|
|
catch (Exception ex) |
|
|
catch (Exception ex) |
|
|
{ |
|
|
{ |
|
|
|
|
|
@ -5,6 +5,7 @@ |
|
|
<RootNamespace>Microsoft.eShopWeb.Web</RootNamespace> |
|
|
<RootNamespace>Microsoft.eShopWeb.Web</RootNamespace> |
|
|
<UserSecretsId>aspnet-Web2-1FA3F72E-E7E3-4360-9E49-1CCCD7FE85F7</UserSecretsId> |
|
|
<UserSecretsId>aspnet-Web2-1FA3F72E-E7E3-4360-9E49-1CCCD7FE85F7</UserSecretsId> |
|
|
<AspNetCoreHostingModel>InProcess</AspNetCoreHostingModel> |
|
|
<AspNetCoreHostingModel>InProcess</AspNetCoreHostingModel> |
|
|
|
|
|
<LangVersion>latest</LangVersion> |
|
|
</PropertyGroup> |
|
|
</PropertyGroup> |
|
|
|
|
|
|
|
|
<ItemGroup> |
|
|
<ItemGroup> |
|
|
|