using Autofac.Extensions.DependencyInjection;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Hosting;
namespace learun.webapi
{
///
/// 程序启动项
///
public class Program
{
///
/// 入口方法
///
///
public static void Main(string[] args)
{
CreateHostBuilder(args).Build().Run();
}
///
/// 主体构建
///
/// 参数
///
public static IHostBuilder CreateHostBuilder(string[] args) =>
Host.CreateDefaultBuilder(args)
.UseServiceProviderFactory(new AutofacServiceProviderFactory())
.ConfigureWebHostDefaults(webBuilder =>
{
webBuilder.UseStartup();
});
}
}