0
votes
Replacing Controller.Session in ASP.NET MVC: Is This Wrong?
Craig Stuntz's Weblog
– Here’s some code I wrote: public class MyBaseController : Controller { // ... public new ISession Session { get; private set; } // .... } ISession is an interface type I wrote which exposes everything I store in the session at runtime. Session, in ASP.NET, is a user-specific cache. This hides Controller.Session (of type HttpSessionStateBase) and replaces it with a strongly-typed, mockable replacement. Normally I wouldn’t use public new, but in this specific case it seems like the best way. It stops developers from using the Web-dependent Session property in derived ...
Statistics
|
Visits by Source |
User Actions |




