コード例 #1
0
        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");
            //}
        }
コード例 #2
0
ファイル: Program.cs プロジェクト: drony/Ark.Tools
        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();
        }
コード例 #3
0
ファイル: NodaTimeDapper.cs プロジェクト: Thieum/Ark.Tools
 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);
 }
コード例 #4
0
        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()
            ;
        }