Пример #1
0
        public void ConfigureServices(IServiceCollection services)
        {
            ConfigureSettings(services);
            var jsonOptions = JsonSerializerExtensions.GetDefaultJsonSerializerSettings();

            services.ConfigureHealthChecks(Configuration);
            services.AddControllers()
            .AddNewtonsoftJson(options =>
            {
                options.SerializerSettings.DateFormatString  = jsonOptions.DateFormatString;
                options.SerializerSettings.NullValueHandling = jsonOptions.NullValueHandling;
                options.SerializerSettings.ContractResolver  = jsonOptions.ContractResolver;
                options.SerializerSettings.Converters.Add(new StringEnumConverter());
            });

            ConfigureDatabases(services);
            services.ConfigureSwaggerSettings(Configuration);
            services.ConfigureSwaggerInfo();
        }