study-lib-backend/Program.cs
2020-12-23 23:35:08 +01:00

31 lines
941 B
C#

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>();
//StudyLibDataSeeder.Initialize(context);
}
host.Run();
// CreateHostBuilder(args).Build().Run();
}
public static IHostBuilder CreateHostBuilder(string[] args) =>
Host.CreateDefaultBuilder(args)
.ConfigureWebHostDefaults(webBuilder =>
{
webBuilder.UseStartup<Startup>();
});
}
}