public void Configure(IApplicationBuilder app) { var configuration = app.GetTestConfiguration(); // Set up application services app.UseServices(services => { // Add MVC services to the services container services.AddMvc(configuration); services.AddTransient <InjectedHelper>(); services.AddTransient <TaskReturningService>(); services.AddTransient <FrameworkSpecificHelper>(); services.Configure <RazorViewEngineOptions>(options => { var expander = new LanguageViewLocationExpander( context => context.HttpContext.Request.Query["language-expander-value"]); options.ViewLocationExpanders.Add(expander); }); }); // Add MVC to the request pipeline app.UseMvc(routes => { routes.MapRoute( name: "default", template: "{controller=Home}/{action=Index}/{id?}"); }); }
// Set up application services public void ConfigureServices(IServiceCollection services) { // Add MVC services to the services container services.AddMvc(); services.AddTransient <InjectedHelper>(); services.AddTransient <TaskReturningService>(); services.AddTransient <FrameworkSpecificHelper>(); services.Configure <RazorViewEngineOptions>(options => { var expander = new LanguageViewLocationExpander( context => context.HttpContext.Request.Query["language-expander-value"]); options.ViewLocationExpanders.Add(expander); options.ViewLocationExpanders.Add(new CustomPartialDirectoryViewLocationExpander()); }); }
public void Configure(IApplicationBuilder app) { var configuration = app.GetTestConfiguration(); // Set up application services app.UseServices(services => { // Add MVC services to the services container services.AddMvc(configuration); services.AddTransient <InjectedHelper>(); services.Configure <RazorViewEngineOptions>(options => { var expander = new LanguageViewLocationExpander( context => context.HttpContext.Request.Query["language-expander-value"]); options.ViewLocationExpanders.Add(expander); }); }); // Add MVC to the request pipeline app.UseMvc(); }
// Set up application services public void ConfigureServices(IServiceCollection services) { // Add MVC services to the services container services.AddMvc(); services.AddTransient <InjectedHelper>(); services.AddTransient <TaskReturningService>(); services.AddTransient <FrameworkSpecificHelper>(); services.Configure <RazorViewEngineOptions>(options => { var expander = new LanguageViewLocationExpander( context => context.HttpContext.Request.Query["language-expander-value"]); options.ViewLocationExpanders.Add(expander); options.ViewLocationExpanders.Add(new CustomPartialDirectoryViewLocationExpander()); }); services.ConfigureMvc(options => { options.HtmlHelperOptions.ClientValidationEnabled = false; options.HtmlHelperOptions.Html5DateRenderingMode = Microsoft.AspNet.Mvc.Rendering.Html5DateRenderingMode.Rfc3339; options.HtmlHelperOptions.IdAttributeDotReplacement = "!"; options.HtmlHelperOptions.ValidationMessageElement = "validationMessageElement"; options.HtmlHelperOptions.ValidationSummaryMessageElement = "validationSummaryElement"; }); }