using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.Logging;
using NLog.Web;
using Microsoft.Extensions.Hosting.WindowsServices;

namespace FAuth
{
    /// <summary>
    /// 进程类
    /// </summary>
    public class Program
    {
        /// <summary>
        /// 进程入口
        /// </summary>
        /// <param name="args"></param>
        public static void Main(string[] args) {
            CreateHostBuilder(args).Build().Run();
        }
        /// <summary>
        /// 创建容易
        /// </summary>
        /// <param name="args"></param>
        /// <returns></returns>
        public static IHostBuilder CreateHostBuilder(string[] args) =>
            Host.CreateDefaultBuilder(args)
                .ConfigureWebHostDefaults(webBuilder => {
                    webBuilder.UseStartup<Startup>();
                })
                .UseWindowsService()
                .ConfigureLogging(c => {
                    c.ClearProviders();
                    c.SetMinimumLevel(LogLevel.Trace);
                })
                .UseNLog();
    }
}
