Skip to content

Latest commit

 

History

History
14 lines (10 loc) · 616 Bytes

README.md

File metadata and controls

14 lines (10 loc) · 616 Bytes

013 - Wolverine functional style

Using Wolverine, or any other mediator, many of our endpoints will look like the following:

app.MapPost("/😡📦", ([FromBody] ParcelReturnCommand parcelReturnRequest, IMessageBus bus) => bus.InvokeAsync(parcelReturnRequest));

We get the input and we pass it onto the bus.

Since this is so common, Wolverine adds an extension that simplifies such calls. We can use MapPostToWolverine and get rid of the passing event onto the bus ourselves. Small update but simplifies our code a bit.

app.MapPostToWolverine<ParcelReturnCommand>("/😡📦");