Created
August 11, 2014 01:55
-
-
Save detroitpro/4b2f7585d25ab37f2e59 to your computer and use it in GitHub Desktop.
NancyFx fake temp data
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
protected override void ApplicationStartup(IWindsorContainer container, IPipelines pipelines) | |
{ | |
pipelines.BeforeRequest += (ctx) => | |
{ | |
if (ctx.Request.Session["TempMessage"] != null && !string.IsNullOrEmpty(ctx.Request.Session["TempMessage"] as string)) | |
{ | |
ctx.ViewBag.TempMessage = ctx.Request.Session["TempMessage"]; | |
ctx.ViewBag.TempType = ctx.Request.Session["TempType"]; | |
ctx.Request.Session.DeleteAll(); | |
} | |
return null; | |
}; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment