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)
        {
            services.AddControllers();
            services.AddSwaggerGen(c =>
            {
                c.SwaggerDoc("v1", new OpenApiInfo {
                    Title = "BWAF", Version = "v1"
                });
            });
            services.AddDbContext <Context>(options => options.UseSqlServer(Configuration.GetConnectionString("DataConnection")));

            services.AddControllers(config =>
            {
                config.Filters.Add(typeof(PerformanceFilter));
            });

            LoggingConfiguration.Init();
            DependencyIndejction.Init(services);
        }