MyViewModel m = context.ActionParameters.Values.SingleOrDefault() as MyViewModel;
Here is the result.
Best Regards,
YihuiSun
ASP.NET forums are moving to a new home on Microsoft Q&A, we encourage you to go to Microsoft Q&A for .NET for posting new questions and get involved today. Learn more >
Contributor
2980 Points
851 Posts
Re: Understanding ASP.NET MVC Lifecycle: Why is Model not available in ActionFilter?
May 12, 2020 09:39 AM|YihuiSun|LINK
Hi, HoomanBahreini
You can get your model in the following way.
MyViewModel m = context.ActionParameters.Values.SingleOrDefault() as MyViewModel;
Here is the result.
Best Regards,
YihuiSun