Skip to content

Instantly share code, notes, and snippets.

@dcomartin
Created March 26, 2016 14:56
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/946a1f6561baea7171c6 to your computer and use it in GitHub Desktop.
Save dcomartin/946a1f6561baea7171c6 to your computer and use it in GitHub Desktop.
public class Module : NancyModule
{
private readonly IMediator _mediator;
public Module(IMediator mediator)
{
_mediator = mediator;
Put["/demo/changepricinglevel/{MessageId:Guid}"] = ChangePricingLevel;
}
private dynamic ChangePricingLevel(dynamic o)
{
var cmd = this.Bind<ChangeCustomerPricingLevel>();
var envelop = new Envelope<ChangeCustomerPricingLevel>((Guid)o.MessageId, 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