Both have Request and Response properties, but I can't write a method that takes either HttpContext or HttpContextBase. In some places either one or the other is available so I need to handle both. I know HttpContextWrapper can convert in one direction, but still... why is it like this?
HttpContext
has been around since .NET 1.0. Because of backward compatibility reasons, they can't change that class. HttpContextBase
was introduced in ASP.NET MVC to allow for better testability because it makes it easier to mock/stub it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With