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();

            CompositionRoot.AddDbContext(services, Configuration);
            CompositionRoot.InjectDependencies(services);

            services.AddAutoMapper(config =>
            {
                config.AddProfile <ApiMappingProfile>();
                config.AddProfile <BusinessMappingProfile>();
            }, typeof(Startup));

            services.AddSwaggerGen(options =>
            {
                options.SwaggerDoc("v1", new OpenApiInfo {
                    Title = "NLayer API", Version = "v1"
                });
            });
        }