MVC Context swapping or Shape Shifting

If your a fan of the request object and you need to pass along in MVC to some class already Defining the System.Web:

There are other solutions but :

var currCtx = this.HttpContext;
var  currPage = (HttpApplication)currCtx.GetService(typeof(HttpApplication));

Location = DA.CoolAppLayer.getInfo(strOfSignifigance, currPage .Context);

 

Und Voilla!!!!!

    Happy Coding  : – D

 

 

ssd

Advertisements

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s