예제 #1
0
        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);
        }
예제 #2
0
 public override void OnAuthorization(HttpActionContext actionContext)
 {
     this.baseController = actionContext.ControllerContext.Controller as BaseApiController;
     base.OnAuthorization(actionContext);
 }