Ejemplo n.º 1
0
        public void Configuration(IAppBuilder app)
        {
            ProjectManagerContext ApplicationContext = new ProjectManagerContext();

            ApplicationContext.Database.Initialize(true);
            ConfigureAuth(app);
        }
Ejemplo n.º 2
0
        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        public void Configure(IApplicationBuilder app, IHostingEnvironment env,
                              ILoggerFactory loggerFactory,
                              ProjectManagerContext projectManagerContext)
        {
            loggerFactory.AddConsole(Configuration.GetSection("Logging"));
            loggerFactory.AddDebug();

            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
            }
            else
            {
                app.UseExceptionHandler();
            }

            projectManagerContext.EnsureSeedDataForContext();

            app.UseStatusCodePages();

            AutoMapper.Mapper.Initialize(cfg =>
            {
                cfg.CreateMap <Project, ProjectDto>();
                cfg.CreateMap <Project, ProjectWithoutUserStoriesDto>();
                cfg.CreateMap <UserStory, UserStoryDto>();
                cfg.CreateMap <CreateUserStoryDto, UserStory>();
                cfg.CreateMap <UpdateUserStoryDto, UserStory>();
                cfg.CreateMap <CreateProjectDto, Project>();
                cfg.CreateMap <UpdateProjectDto, Project>();
            });

            app.UseMvc();
        }