Vote UpVote

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 ...
Favorite? Off-Topic? Craig Stuntz @ 2010-06-17 23:44


Visits: 272
Votes: 0
Favorites: 0
Off-Topic: 0

Visits by Source

User Actions

Users who voted for this posting

Contact us to advertise on DelphiFeeds.com

Community Links

Torry Firebird News


Please login or register to use this functionality.
(click on this box to dismiss)