Example #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 void ConfigureContainer(ServiceRegistry services)
        {
            services.AddOptions();
            services.Configure <PersistenceConfiguration>(_config.GetSection(nameof(PersistenceConfiguration)));

            services.AddHealthChecks()
            .AddCheck <ContainerHealthCheck>("ioc")
            .AddCheck <DatabaseHealthCheck>("database");

            services.AddAuthenticationConfiguration(_config);

            services.AddMvc()
            .SetCompatibilityVersion(CompatibilityVersion.Version_2_2)
            .AddJsonOptions(options =>
            {
                options.SerializerSettings.Converters.Add(new Newtonsoft.Json.Converters.StringEnumConverter());
                options.SerializerSettings.NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore;
            });

            services.AddSignalR();

            services.AddSwaggerConfiguration();

            services.AddCorsConfiguration();
        }