public class Program
{
/*
* 1:项目中添加文件host.json 内容如下
*
{
"urls": "http://localhost:6004;https://localhost:6005"
}
2:修改main方法如下
*/
public static void Main(string[] args)
{
var config = new ConfigurationBuilder().SetBasePath(Directory.GetCurrentDirectory()).AddJsonFile("host.json", true).Build();
var host = CreateWebHostBuilder(args).UseConfiguration(config).Build();
host.Run();
//IWebHost host = CreateWebHostBuilder(args).Build();
var db = host.Services.GetService(typeof(DncZeusDbContext)) as DncZeusDbContext;
DataSeeder.Seeds(db);
//host.Run();
}
public static IWebHostBuilder CreateWebHostBuilder(string[] args) =>
WebHost.CreateDefaultBuilder(args)
.UseStartup<Startup>();
}