Пример #1
0
        // This method gets called by the runtime. Use this method to add services to the container.
        public void ConfigureServices(IServiceCollection services)
        {
            services.AddMvc().AddJsonOptions(option =>
            {
                option.JsonSerializerOptions.IgnoreNullValues = true;
            }).SetCompatibilityVersion(CompatibilityVersion.Version_3_0)
            .AddMvcOptions(option => option.EnableEndpointRouting = false)
            .AddNewtonsoftJson(options =>
                               options.SerializerSettings.ContractResolver = new CamelCasePropertyNamesContractResolver());

            services.AddControllers();

            DependencyInjections.AddInfraStructure(services, Configuration);
            var configuration = GetConfiguration();

            services.AddSingleton(typeof(IConfiguration), configuration);

            services.AddSwaggerDocument(config =>
            {
                config.PostProcess = document =>
                {
                    document.Info.Version = "v1";
                    document.Info.Title   = "API Distribuição de Lucros";
                };
            });
        }