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() .UseUrls("http://localhost:29021") .Build(); using(var scope = host.Services.CreateScope()) { var db = scope.ServiceProvider.GetService(); db.Database.Migrate(); } return host; } } }