// This method gets called by the runtime. Use this method to configure the HTTP request pipeline. public void Configure(IApplicationBuilder app, IHostingEnvironment env, AutoMapper.IConfigurationProvider autoMapper) { app.UseDatabaseMigration(); if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); app.UseDatabaseErrorPage(); } else { app.UseExceptionHandler("/News/Error"); app.UseHsts(); } app.UseHttpsRedirection(); app.UseStaticFiles(); app.UseCookiePolicy(); app.UseAuthentication(); app.UseHttpsRedirection(); app.UseMvc(routes => { routes.MapRoute( name: "areas", template: "{area:exists}/{controller=News}/{action=Index}/{id?}"); routes.MapRoute( name: "default", template: "{controller=News}/{action=Index}/{id?}"); }); //autoMapper.AssertConfigurationIsValid(); }
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline. public void Configure(IApplicationBuilder app, IWebHostEnvironment env, AutoMapper.IConfigurationProvider autoMapper) { if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); app.UseDatabaseErrorPage(); } else { app.UseExceptionHandler("/Home/Error"); // The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts. app.UseHsts(); } //autoMapper.AssertConfigurationIsValid(); app.UseRequestLocalization("en-US"); app.UseHttpsRedirection(); app.UseStaticFiles(); app.UseRouting(); app.UseAuthentication(); app.UseAuthorization(); app.UseEndpoints(endpoints => { endpoints.MapControllerRoute( name: "default", pattern: "{controller=Home}/{action=Index}/{id?}"); endpoints.MapRazorPages(); }); }
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline. public void Configure(IApplicationBuilder app, IWebHostEnvironment env, AutoMapper.IConfigurationProvider autoMapperConfigProvider) { app.ConfigureStartup(env, autoMapperConfigProvider); #region Angular SPA app.UseStaticFiles(); if (!env.IsDevelopment()) { app.UseSpaStaticFiles(); } #endregion // app.UseEndpoints(endpoints => // { // //endpoints.MapControllerRoute( // // name: "default", // // pattern: "{controller}/{action=Index}/{id?}"); // }); #region Angular SPA app.UseSpa(spa => { // To learn more about options for serving an Angular SPA from ASP.NET Core, // see https://go.microsoft.com/fwlink/?linkid=864501 spa.Options.SourcePath = "ClientApp"; if (env.IsDevelopment()) { spa.UseAngularCliServer(npmScript: "start"); } }); #endregion }
public InstanceBasedAutoMapperWrapper(AM.IConfigurationProvider configuration, bool skipValidnessAssertation = false) { Configuration = configuration; if (!skipValidnessAssertation) { configuration.AssertConfigurationIsValid(); } Instance = configuration.CreateMapper(); }
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline. public void Configure( IApplicationBuilder app, IHostingEnvironment env, AutoMapper.IConfigurationProvider autoMapper) { autoMapper.AssertConfigurationIsValid(); if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); } app.UseSwagger() .UseSwaggerUI(c => c.SwaggerEndpoint("/swagger/v1/swagger.json", "My API V1")); app.UseMvc(); }
public void Configure(IApplicationBuilder app, IWebHostEnvironment env, AutoMapper.IConfigurationProvider configurationProvider, ILogger <Startup> logger) { if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); app.UseDatabaseErrorPage(); } else { app.UseExceptionHandler(errorApp => { errorApp.Run(async context => { var exceptionHandler = context.Features.Get <IExceptionHandlerPathFeature>(); logger.LogError(exceptionHandler.Error, $"Error has been ocured in: {exceptionHandler.Path}; Message: {exceptionHandler.Error.Message}"); context.Response.Redirect("/Home/Error"); await Task.CompletedTask; }); }); app.UseHsts(); } app.UseHttpsRedirection(); app.UseStaticFiles(); var locOptions = app.ApplicationServices.GetService <IOptions <RequestLocalizationOptions> >(); app.UseRequestLocalization(locOptions.Value); app.UseRouting(); app.UseAuthentication(); app.UseAuthorization(); app.UseEndpoints(endpoints => { endpoints.MapControllerRoute( name: "default", pattern: "{controller=Home}/{action=Index}/{id?}"); // TODO: Will be removed when Identity Razor Pages will be refactored to MVC endpoints.MapRazorPages(); }); configurationProvider.AssertConfigurationIsValid(); }
public void Configure(IApplicationBuilder app, IHostingEnvironment env, AutoMapper.IConfigurationProvider autoMapper) { autoMapper.AssertConfigurationIsValid(); if (env.IsDevelopment()) { app.UseCustomSwagger(); } else { app.UseHsts(); } app.UseCors(CorsExtensions.AllowWebServerCorsPolicy); app.UseHttpsRedirection(); app.UseAuthentication(); app.UseMvc(); }
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline. public void Configure(IApplicationBuilder app, IWebHostEnvironment env, AutoMapper.IConfigurationProvider autoMapper) { if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); } autoMapper.AssertConfigurationIsValid(); app.UseHttpsRedirection(); app.UseRouting(); app.UseAuthorization(); app.UseEndpoints(endpoints => { endpoints.MapControllers(); }); }
public void Configure(IApplicationBuilder app, IWebHostEnvironment env, AutoMapper.IConfigurationProvider mapper) { if (env.IsDevelopment()) { mapper.AssertConfigurationIsValid(); app.UseDeveloperExceptionPage(); } else { mapper.CompileMappings(); app.UseExceptionHandler("/Home/Error"); app.UseHsts(); } app.UseHttpsRedirection(); app.UseStaticFiles(); app.UseRouting(); app.UseAuthorization(); app.UseEndpoints(endpoints => { endpoints.MapControllerRoute( name: "Create", pattern: "{controller=Order}/create", defaults: new { controller = "Order", action = "ModificationOrder" } ); endpoints.MapControllerRoute( name: "Edit", pattern: "{controller=Order}/edit/{id}", defaults: new { controller = "Order", action = "ModificationOrder" } ); endpoints.MapControllerRoute( name: "default", pattern: "{controller=Order}/{action=GetOrders}/{id?}"); endpoints.MapRazorPages(); }); }
protected BaseDataService() { _cacheService = ServiceLocator.Current.GetInstance <ICacheService>(); mapperConfig = ServiceLocator.Current.GetInstance <AutoMapper.IConfigurationProvider>(); _config = ServiceLocator.Current.GetInstance <NarikModulesConfig>(); LocalizationService = ServiceLocator.Current.GetInstance <ILocalizationService>(); _entityUpdatePushService = ServiceLocator.Current.GetInstance <IEntityUpdatePushService>(); LoggingService = ServiceLocator.Current.GetInstance <ILoggingService>(); Configuration = ServiceLocator.Current.GetInstance <IConfiguration>(); lock (_lock) { if (!DomainServiceDescriptions.ContainsKey(GetType())) { DomainServiceDescriptions.TryAdd(GetType(), new DomainServiceDescription(GetType())); } DomainServiceDescription = DomainServiceDescriptions[GetType()]; } DbContext = CreateDbContext(); }
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline. public void Configure(IApplicationBuilder app, IHostingEnvironment env, AutoMapper.IConfigurationProvider autoMapper) { if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); } else { app.UseExceptionHandler("/Error"); //app.UseDefaultFiles(); } app.UseStaticFiles(); app.UseSpaStaticFiles(); app.UseMvc(routes => { routes.MapRoute( name: "default", template: "{controller}/{action=Index}/{id?}"); }); app.UseSpa(spa => { // To learn more about options for serving an Angular SPA from ASP.NET Core, // see https://go.microsoft.com/fwlink/?linkid=864501 spa.Options.SourcePath = "ClientApp"; if (env.IsDevelopment()) { spa.UseAngularCliServer(npmScript: "start"); } }); app.UseAuthentication(); autoMapper.AssertConfigurationIsValid(); }
public void Configure(IApplicationBuilder app, IHostingEnvironment env, AutoMapper.IConfigurationProvider autoMapper) { if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); } app.UseGlobalExceptionHandler(); app.UseSwagger(); app.UseSwaggerUI(c => { c.SwaggerEndpoint("/swagger/v1/swagger.json", "WI.ApiBoilerplate V1"); }); app.UseCors(builder => builder .AllowAnyOrigin() .AllowAnyMethod() .AllowAnyHeader() .AllowCredentials()); app.UseMvc(); autoMapper.AssertConfigurationIsValid(); }
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline. public void Configure(IApplicationBuilder app, IHostingEnvironment env, DbIntinitializer dbIntinitializer, ILoggerFactory loggerFactory, IConfigurationProvider autoMapper) { loggerFactory.AddFile("Logs/tedu-{Date}.txt"); if (env.IsDevelopment()) { app.UseBrowserLink(); app.UseDeveloperExceptionPage(); app.UseDatabaseErrorPage(); } else { app.UseExceptionHandler("/Home/Error"); } app.UseStaticFiles(); app.UseAuthentication(); app.UseMvc(routes => { routes.MapRoute( name: "default", template: "{controller=Home}/{action=Index}/{id?}"); routes.MapRoute( name: "areaRoute", template: "{area:exists}/{controller=Login}/{action=Index}/{id?}"); }); dbIntinitializer.Seed().Wait(); }
public static async Task <IPagedList <TDestination> > ProjectToPagedListAsync <TDestination>( this IOrderedQueryable queryable, IConfigurationProvider configurationProvider, int pageNumber, int pageSize) => await queryable.ProjectTo <TDestination>(configurationProvider).Decompile() .ToPagedListAsync(pageNumber, pageSize);
public StatisticService( FXDataContext context, AutoMapper.IConfigurationProvider mappingConfiguration) { _context = context; _mappingConfiguration = mappingConfiguration; }
public static void Configure(IApplicationBuilder app, IWebHostEnvironment env, IConfigurationProvider autoMapper) { if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); autoMapper.AssertConfigurationIsValid(); } app.UseHttpActivities(); using var scope = app.ApplicationServices.CreateScope(); var scopeProvider = scope.ServiceProvider; var context = scopeProvider.GetRequiredService <ElsaContext>(); context.Database.Migrate(); app.UseStaticFiles() .UseMvc(routes => { routes.MapRoute( name: "default", template: "{controller}/{action=Index}/{id?}"); }); }
public SampleOrdersController(SampleContext context, IMapper mapper, AutoMapper.IConfigurationProvider autoMapper) { this.context = context; this.mapper = mapper; this.autoMapper = autoMapper; }