39 lines
1019 B
C#
39 lines
1019 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.IO;
|
|
using System.Linq;
|
|
using System.Threading.Tasks;
|
|
using Microsoft.AspNetCore;
|
|
using Microsoft.AspNetCore.Hosting;
|
|
using Microsoft.EntityFrameworkCore;
|
|
using Microsoft.Extensions.Configuration;
|
|
using Microsoft.Extensions.DependencyInjection;
|
|
using Microsoft.Extensions.Logging;
|
|
|
|
namespace OFBButte.Api
|
|
{
|
|
public class Program
|
|
{
|
|
public static void Main(string[] args)
|
|
{
|
|
CreateWebHostBuilder(args).Run();
|
|
}
|
|
|
|
public static IWebHost CreateWebHostBuilder(string[] args)
|
|
{
|
|
var host = WebHost.CreateDefaultBuilder(args)
|
|
.UseStartup<Startup>()
|
|
.UseUrls("http://localhost:29021")
|
|
.Build();
|
|
|
|
using(var scope = host.Services.CreateScope())
|
|
{
|
|
var db = scope.ServiceProvider.GetService<Database.OFBContext>();
|
|
db.Database.Migrate();
|
|
}
|
|
|
|
return host;
|
|
}
|
|
}
|
|
}
|