Created
July 1, 2016 03:26
-
-
Save rexcfnghk/84dc6bddb02f42be67dfeabb3703fe08 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class UserProfileActionFilterAttribute : ActionFilterAttribute | |
| { | |
| private readonly UserProfile _userProfile; | |
| public UserProfileActionFilterAttribute(UserProfile userProfile) | |
| { | |
| _userProfile = userProfile; | |
| } | |
| public override void OnActionExecuting(ActionExecutingContext filterContext) | |
| { | |
| filterContext.Controller.ViewBag.User = _userProfile; | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment