public static void InitStatic(string[] args) { args = args ?? Array.Empty <string>(); //DapperNodaTimeSetup.Register(); NodeTimeConverter.Register(); ServicePointManager.UseNagleAlgorithm = true; ServicePointManager.Expect100Continue = false; ServicePointManager.CheckCertificateRevocationList = true; ServicePointManager.DefaultConnectionLimit = 250; ServicePointManager.EnableDnsRoundRobin = true; ServicePointManager.DnsRefreshTimeout = 4 * 60 * 1000; var cfg = new ConfigurationBuilder() .SetBasePath(Directory.GetCurrentDirectory()) .AddJsonFile("appsettings.json", optional: false, reloadOnChange: true) .AddJsonFile($"appsettings.{Environment.GetEnvironmentVariable("ASPNETCORE_ENVIRONMENT")}.json", optional: true) .AddEnvironmentVariables() .AddCommandLine(args) .Build() ; //var ns = "ProblemDetailsSample"; //NLogConfigurer.For(ns) // .WithDefaultTargetsAndRules(ns.Replace('.', '_'), cfg.GetConnectionString("NLog.Database"), cfg["NLog:NotificationList"] // , cfg["NLog:Smtp:Server"], Convert.ToInt32(cfg["NLog:Smtp:Port"]), cfg["NLog:Smtp:Username"], cfg["NLog:Smtp:Password"], Convert.ToBoolean(cfg["NLog:Smtp:UseSsl"])) // //.WithDatabaseRule(@"*", NLog.LogLevel.Trace) // .Apply(); //if (Debugger.IsAttached) //{ // LogManager.Configuration.AddTarget("Debugger", new DebuggerTarget("Debugger")); // LogManager.Configuration.AddRuleForAllLevels("Debugger"); //} }
public static void InitStatic(string[] args) { args = args ?? Array.Empty <string>(); //DapperNodaTimeSetup.Register(); NodeTimeConverter.Register(); ServicePointManager.UseNagleAlgorithm = true; ServicePointManager.Expect100Continue = false; ServicePointManager.CheckCertificateRevocationList = true; ServicePointManager.DefaultConnectionLimit = 250; ServicePointManager.EnableDnsRoundRobin = true; ServicePointManager.DnsRefreshTimeout = 4 * 60 * 1000; var cfg = new ConfigurationBuilder() .SetBasePath(Directory.GetCurrentDirectory()) .AddJsonFile("appsettings.json", optional: false, reloadOnChange: true) .AddJsonFile($"appsettings.{Environment.GetEnvironmentVariable("ASPNETCORE_ENVIRONMENT")}.json", optional: true) .AddEnvironmentVariables() .AddCommandLine(args) .Build() ; var ns = "WebApplicationDemo"; NLogConfigurer.For(ns) .WithArkDefaultTargetsAndRules(ns.Replace('.', '_'), cfg.GetConnectionString("NLog.Database") , "*****@*****.**", cfg["NLog:NotificationList"] , cfg.GetConnectionString("NLog.Smtp")) .Apply(); }
public static void Setup() { NodeTimeConverter.Register(); SqlMapper.AddTypeHandler(InstantHandler.Instance); SqlMapper.AddTypeHandler(LocalDateHandler.Instance); SqlMapper.AddTypeHandler(LocalDateTimeHandler.Instance); SqlMapper.AddTypeHandler(LocalTimeHandler.Instance); SqlMapper.AddTypeHandler(OffsetDateTimeHandler.Instance); }
public static void InitStatic(string[] args) { args = args ?? Array.Empty <string>(); //DapperNodaTimeSetup.Register(); NodeTimeConverter.Register(); ServicePointManager.UseNagleAlgorithm = true; ServicePointManager.Expect100Continue = false; ServicePointManager.CheckCertificateRevocationList = true; ServicePointManager.DefaultConnectionLimit = 250; ServicePointManager.EnableDnsRoundRobin = true; ServicePointManager.DnsRefreshTimeout = 4 * 60 * 1000; var cfg = new ConfigurationBuilder() .SetBasePath(Directory.GetCurrentDirectory()) .AddJsonFile("appsettings.json", optional: false, reloadOnChange: true) .AddJsonFile($"appsettings.{Environment.GetEnvironmentVariable("ASPNETCORE_ENVIRONMENT")}.json", optional: true) .AddEnvironmentVariables() .AddCommandLine(args) .Build() ; }