Skip to content

Instantly share code, notes, and snippets.

@dcomartin
Last active March 19, 2016 17:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dcomartin/521339db55afbbdc1ebf to your computer and use it in GitHub Desktop.
Save dcomartin/521339db55afbbdc1ebf to your computer and use it in GitHub Desktop.
public class Module : NancyModule
{
private readonly IMediator _mediator;
public Module(IMediator mediator)
{
_mediator = mediator;
Post["/demo/changepricinglevel"] = ChangePricingLevel;
}
private dynamic ChangePricingLevel(dynamic o)
{
var cmd = this.Bind<ChangeCustomerPricingLevel>();
var envelop = new Envelope<ChangeCustomerPricingLevel>(cmd);
_mediator.SendAsync(envelop);
return HttpStatusCode.NoContent;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment