My problem is the opposite of this: How do I convert an HttpRequestBase into an HttpRequest object?
In my ASP.NET MVC application I have a method used by many controlle
I find the following extension methods useful:
public static HttpContextBase AsBase(this HttpContext context)
{
return new HttpContextWrapper(context);
}
public static HttpRequestBase AsBase(this HttpRequest context)
{
return new HttpRequestWrapper(context);
}
Usage:
HttpContext.Current.AsBase()
HttpContext.Current.Request.AsBase()