My idea was to create my own HttpContext, which would include some of the internal objects used in our application. So I thought Iβd just create
public class FooHttpContextBase : HttpContextBase
{
public string Foo
{
get { return "Boo"; }
}
}
And then override the HttpContext property:
public abstract class BaseController : Controller
{
private FooHttpContextBase context;
public BaseController()
{
context = new FooHttpContextBase();
}
override public HttpContextBase HttpContext
{
get { return context; }
}
}
But then I realized that the HttpContext is not virtual - so it cannot be redefined.
What are you offering? Add new property to BaseController?
Thanks in advance!
palig source
share