Let’s have a action filter where I’m accessing the httpcontext in two ways.
public class Filter : ActionFilterAttribute
{
public override void OnActionExecuting(ActionExecutingContext context)
{
var context1 = context.HttpContext;
var context2 = HttpContext.Current;
}
}
My question, if there is any difference between those two instances except the fact that accessing the instance through HttpContext.Current makes the code test unfriendly ?
No there is not difference as they are pointing at the same object