コード例 #1
0
 /// <summary>
 /// Seeds on startup.
 /// </summary>
 /// <param name="host">Injected IWebHost for services</param>
 /// <returns>The same IWebHost is returned for chaining</returns>
 private static IWebHost StartUpSeed(IWebHost host)
 {
     try
     {
         using (var scope = host.Services.CreateScope())
         {
             Seed.CreateAll
             (
                 scope.ServiceProvider.GetRequiredService <IServiceProvider>()
             ).Wait();
         }
     }
     catch (Exception)
     {
     }
     return(host);
 }