As far as Web API is concerned the System.Web.HttpContext.Current
is not always guaranteed. It depends on whether you are using Web API Self hosted or not. That is the main reason that when overriding System.Web.Http.Filters.ActionFilterAttribute.OnActionExecuting
you don't get an httpcontext property on the HttpActionContext
parameter (In AspNet MVC you do).
The best way to do the same is the actionContext.Request.Properties
dictionary.
check also this answer here