Skip to content

Instantly share code, notes, and snippets.

@detroitpro
Created August 11, 2014 01:55
Show Gist options
  • Save detroitpro/4b2f7585d25ab37f2e59 to your computer and use it in GitHub Desktop.
Save detroitpro/4b2f7585d25ab37f2e59 to your computer and use it in GitHub Desktop.
NancyFx fake temp data
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