This commit is contained in:
2021-12-13 01:23:07 +01:00
parent 9b25a3ea8b
commit 77a5c1a8ad
+11 -1
View File
@@ -17,7 +17,17 @@ app.MapWhen(ctx => ctx.Request.Path.StartsWithSegments("/zero/api"), branch =>
branch.UsePathBase(new PathString("/zero/api"));
branch.UseEndpoints(endpoints =>
{
endpoints.MapControllers();
// TODO https://www.codeproject.com/Questions/5262381/How-to-add-prefix-to-URL-in-MVC-based-on-roles
// see
/*
* routes.MapRoute(
name: "Default",
url: "{role}/{controller}/{action}/{id}",
defaults: new { role = "User", controller = "Home", action = "Index", id = UrlParameter.Optional }
).RouteHandler = new UserRoleHandler();
*/
endpoints.MapControllerRoute("name", "pattern").
});
});