路由

2019-04-04 17:40 更新

WTM框架本身為你配置了標(biāo)準(zhǔn)的路由,如果需要自定義,可以修改Program.cs文件配置自己的路由

定義數(shù)據(jù)路由
  1. public class Program
  2. {
  3. public static void Main(string[] args)
  4. {
  5. BuildWebHost(args).Run();
  6. }
  7. public static IWebHost BuildWebHost(string[] args) =>
  8. WebHost.CreateDefaultBuilder(args)
  9. .ConfigureServices(x =>
  10. {
  11. x.AddFrameworkService(dataPrivilegeSettings: pris);
  12. x.AddLayui();
  13. })
  14. .Configure(x =>
  15. {
  16. x.UseFrameworkService(routes =>
  17. {
  18. routes.MapRoute(
  19. name: "areaRoute",
  20. template: "{area:exists}/{controller=Home}/{action=Index}/{id?}");
  21. routes.MapRoute(
  22. name: "default",
  23. template: "{controller=Home}/{action=Index}/{id?}");
  24. });
  25. })
  26. .Build();
  27. }


以上內(nèi)容是否對您有幫助:
在線筆記
App下載
App下載

掃描二維碼

下載編程獅App

公眾號
微信公眾號

編程獅公眾號