asp.net mvc - How to get route name from Attribute routing in ASP MVC5 -
asp.net mvc - How to get route name from Attribute routing in ASP MVC5 -
does know how route name attribute routing in action filter?
for illustration have controller , attribute route this:
[httpget] [customactionattribute] [route("~/index", name="indexpage")] public async task<actionresult> index() { //controller logic }
is possible route name in customactionattribute?
public override void onactionexecuting(actionexecutingcontext filtercontext) { //get current route name here }
you can extend routecollection accomplish this. can find illustration code here
asp.net-mvc routes asp.net-mvc-5 attributerouting
Comments
Post a Comment