protected override void OnActionExecuting(ActionExecutingContext filterContext) { DbContext = (InspectRContext)HttpContext.Items["InspectRContext"]; _service = new InspectRService(DbContext); if (User != null) { var username = User.Identity.Name; if (!string.IsNullOrEmpty(username)) { // todo: map a dto ViewBag.UserProfile = DbContext.GetUserProfile(username); } } base.OnActionExecuting(filterContext); }
protected override void OnActionExecuting(ActionExecutingContext filterContext) { DbContext = (InspectRContext)HttpContext.Items["InspectRContext"]; _service = new InspectRService(DbContext); base.OnActionExecuting(filterContext); }