study-lib-backend/Program.cs

31 lines
941 B
C#
Raw Normal View History

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