I have a controller which inherits from a BaseController class. This BaseController has a protected property currentUser which is of type myUser.
I have created a "Custom Action Filter Attribute" and I need to access the value of myUser within this atrtribute's OnActionExecuting() event.
Is this possible? If so, how can I implement this feature?
Regards.
Yes you can do it but first you have convert your currentUser property from protected to public or expose it through read only property or method.
Then you can access it using the following
var baseController = filterContext.Controller as BaseController;
if (baseController != null) {
//Access your exposed **public** property or method
baseController.currentUser
}