Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
public class Module : NancyModule
public Module(IMediator mediator)
Put["/customers/{CustomerId:Guid}/changepricinglevel/{MessageId:Guid}", true] = async (parameters, token) =>
var cmd = this.Bind<Command>();
var envelope = new Envelope<Command>((Guid)parameters.MessageId, cmd);
await mediator.SendAsync(envelope);
return HttpStatusCode.NoContent;
catch (Exception ex)
// Set the reference id of the event so we can search for it later (reference:id).
// This will automatically be populated if you call ExceptionlessClient.Default.Configuration.UseReferenceIds();
// Add the envelope command object
.AddObject(envelope, "ChangePricingLevel")
// Set the customerId
.SetProperty("CustomerId", parameters.CustomerID)
// Add an Command tag.
// Mark critical.
// Submit the event.
return HttpStatusCode.InternalServerError;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment