Skip to content

Instantly share code, notes, and snippets.

@JefClaes
Last active December 16, 2015 15:49
Show Gist options
  • Select an option

  • Save JefClaes/5458275 to your computer and use it in GitHub Desktop.

Select an option

Save JefClaes/5458275 to your computer and use it in GitHub Desktop.
I do something very similar to what @tjaskula is doing. I approve!
public class ConfirmationModule : NancyModule
{
public ConfirmationModule(IBus bus)
{
Get["confirm/done"] = p =>
{
return View["ConfirmationDone"];
};
Post["confirm/{token}"] = p =>
{
Guid parsedToken;
if (Guid.TryParse(p.token, out parsedToken))
{
bus.ExecuteCommand(new ConfirmQueryCommand(p.token));
return Response.AsRedirect("done");
}
return HttpStatusCode.NotFound;
};
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment