According to the docs, instance members are not guaranteed to be thread safe. That seems odd to me because on every request a new instance of the controller is created, so why would there be any problem?
What I'd like to do is the following:
public MyController : Controller { private string _myAwesomeUserName; protected override void OnAuthorization(AuthorizationContext filterContext) { _myAwesomeUserName = "BobIsTheMan"; } public ActionResult ViewSnowboardCollection() { return View(_myAwesomeUserName); } } Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
https://msdn.microsoft.com/en-us/library/system.web.mvc.controller%28v=vs.118%29.aspx