public override void OnAuthorization(HttpActionContext actionContext) { var Db = new ApplicationDbContext(); BaseApiController baseController = actionContext.ControllerContext.Controller as BaseApiController; string aspUserID = actionContext.RequestContext.Principal.Identity.GetUserId(); if (aspUserID != null) { baseController.BaseService.UserID = Db.Users.Where(w => w.Id == aspUserID).FirstOrDefault().UserID; } base.OnAuthorization(actionContext); }
public override void OnAuthorization(HttpActionContext actionContext) { this.baseController = actionContext.ControllerContext.Controller as BaseApiController; base.OnAuthorization(actionContext); }