Esempio n. 1
0
        public void ConfigureServices(IServiceCollection services)
        {
            services.AddMvc();
            DependencyInjectionConfigure.Configure(services);

            services.AddLogging(loggingBuilder =>
                                loggingBuilder.AddSerilog(dispose: true));
            //services.AddLogging();
            ConfigureMapper(services);
        }
Esempio n. 2
0
        // This method gets called by the runtime. Use this method to add services to the container.
        public void ConfigureServices(IServiceCollection services)
        {
            DependencyInjectionConfigure.ConfigureDependencies(services, Configuration);

            services.AddCors();

            services.AddMvc()
            .AddJsonOptions(x => x.SerializerSettings.ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Ignore)
            .SetCompatibilityVersion(CompatibilityVersion.Version_2_1);

            services.AddSwaggerGen(c =>
            {
                c.SwaggerDoc("v1", new Info {
                    Title = "Arquitect Challenge", Version = "v1"
                });

                var xmlFile = $"{Assembly.GetExecutingAssembly().GetName().Name}.xml";
                var xmlPath = Path.Combine(AppContext.BaseDirectory, xmlFile);

                c.IncludeXmlComments(xmlPath);
            });
        }