Skip to content

Instantly share code, notes, and snippets.

@dcomartin dcomartin/module.cs

Created Apr 4, 2016
Embed
What would you like to do?
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
You can’t perform that action at this time.