Exemplo n.º 1
0
        private void Bootstrap()
        {
            Bootstrapper.Bootstrap(_container);
            MapperBootstrapper.Bootstrap(_cfg);

            Mapper.Initialize(_cfg);
        }
Exemplo n.º 2
0
        // This method gets called by the runtime. Use this method to add services to the container.
        public void ConfigureServices(IServiceCollection services)
        {
            var config = new MapperConfigurationExpression();

            MapperBootstrapper.Bootstrap(config);
            Mapper.Initialize(config);

            services.AddDbContext <ApplicationContext>(options =>
                                                       options.UseSqlServer(Configuration.GetConnectionString("DefaultConnection")));

            Bootstrapper.Bootstrap(services);

            services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_1);

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