Advertisement
Guest User

Untitled

a guest
Jun 20th, 2019
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.05 KB | None | 0 0
  1. public void Configure(IApplicationBuilder app, IHostingEnvironment env)
  2. {
  3. app.UseAuthentication();
  4. var locOptions =
  5. app.ApplicationServices.GetService<IOptions<RequestLocalizationOptions>>();
  6.  
  7.  
  8. app.UseRequestLocalization(locOptions.Value);
  9.  
  10. CultureInfo cultureInfo = Thread.CurrentThread.CurrentCulture;
  11. var culture = cultureInfo.Name;
  12.  
  13. if (env.IsDevelopment())
  14. {
  15. app.UseDeveloperExceptionPage();
  16. }
  17.  
  18. app.UseStaticFiles();
  19. app.UseSession();
  20.  
  21. //configuring mvc routes...
  22. app.UseMvc(routes =>
  23. {
  24. routes.MapRoute(
  25. name: "areaRoute",
  26. template: "{area:exists}/{controller}/{action}/{id?}",
  27. defaults: new { controller = "Home", action = "Index" });
  28.  
  29. routes.MapRoute(
  30. name: "default",
  31. template: "{culture}/{controller}/{action}/{id?}",
  32. defaults: new { culture = culture, controller = "Home", action = "Index" });
  33. });
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement