2020-12-12 14:47:20 +01:00
|
|
|
using Microsoft.AspNetCore.Hosting;
|
|
|
|
using Microsoft.Extensions.Hosting;
|
|
|
|
using StudyLib.API.Data;
|
|
|
|
using Microsoft.Extensions.DependencyInjection;
|
|
|
|
|
|
|
|
namespace StudyLib
|
|
|
|
{
|
|
|
|
public class Program
|
|
|
|
{
|
|
|
|
public static void Main(string[] args)
|
|
|
|
{
|
|
|
|
var host = CreateHostBuilder(args).Build();
|
|
|
|
using (var scope = host.Services.CreateScope())
|
|
|
|
{
|
|
|
|
var services = scope.ServiceProvider;
|
|
|
|
var context = services.GetService<StudyLibContext>();
|
2020-12-23 23:35:08 +01:00
|
|
|
//StudyLibDataSeeder.Initialize(context);
|
2020-12-12 14:47:20 +01:00
|
|
|
}
|
|
|
|
host.Run();
|
|
|
|
// CreateHostBuilder(args).Build().Run();
|
|
|
|
}
|
|
|
|
|
|
|
|
public static IHostBuilder CreateHostBuilder(string[] args) =>
|
|
|
|
Host.CreateDefaultBuilder(args)
|
|
|
|
.ConfigureWebHostDefaults(webBuilder =>
|
|
|
|
{
|
|
|
|
webBuilder.UseStartup<Startup>();
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|