예제 #1
0
        // This method gets called by the runtime. Use this method to add services to the container.
        // For more information on how to configure your application, visit https://go.microsoft.com/fwlink/?LinkID=398940
        public virtual void ConfigureServices(IServiceCollection services)
        {
            MvcConfigurationManager.ConfigureService(services);
            CacheConfigurationManager.ConfigureService(services, this.configuration);
            services.AddServiceLogging();
            services.AddSwaggerGen(c =>
            {
                c.SwaggerDoc("v1", new Info
                {
                    Version        = "v1",
                    Title          = "hello",             //this.configuration.GetSection("service:title").ToString(),
                    Description    = "hello description", //this.configuration.GetSection("service:description").ToString(),
                    TermsOfService = "None",
                    Contact        = new Contact()
                    {
                        Name = "{service.companyname}", Email = "{service.companyemail}", Url = "{service.companyemail}"
                    }
                });
            });
            configureDependency(services);
            //services.AddSingleton<Serilog.ILogger, Serilog.Logger>();

            /*services.AddHsts(options =>
             * {
             *  options.Preload = true;
             *  options.IncludeSubDomains = true;
             *  options.MaxAge = TimeSpan.FromDays(60);
             *  options.ExcludedHosts.Add("example.com");
             *  options.ExcludedHosts.Add("www.example.com");
             * });
             */
        }
        // This method gets called by the runtime. Use this method to add services to the container.
        // For more information on how to configure your application, visit https://go.microsoft.com/fwlink/?LinkID=398940
        public virtual void ConfigureServices(IServiceCollection services)
        {
            MvcConfigurationManager.ConfigureService(services);
            CacheConfigurationManager.ConfigureService(services, this.configuration);
            LoggingConfigurationManager.ConfigureService(services);
            configureDependency(services);
            //services.AddSingleton<Serilog.ILogger, Serilog.Logger>();

            /*services.AddHsts(options =>
             * {
             *  options.Preload = true;
             *  options.IncludeSubDomains = true;
             *  options.MaxAge = TimeSpan.FromDays(60);
             *  options.ExcludedHosts.Add("example.com");
             *  options.ExcludedHosts.Add("www.example.com");
             * });
             */
        }