Exemplo n.º 1
0
        // This method gets called by the runtime. Use this method to add services to the container.
        public void ConfigureServices(IServiceCollection services)
        {
            //general universal preferences I have for apps
            services.AddHttpContextAccessor();
            services.AddMvc()
            .AddJsonOptions(options =>
            {
                options.JsonSerializerOptions.Converters.Add(new JsonStringEnumConverter());
                options.JsonSerializerOptions.IgnoreNullValues = true;
            });

            //auth
            DependencyConfiguration.RegisterAuthDependencies(services, Configuration);

            //application dependencies
            DependencyConfiguration.RegisterApplicationDependencies(services, Configuration);

            //register the controllers as dependencies
            services.AddControllers();

            //register swagger dependencies
            services.AddSwaggerGen();
        }