Arley Pádua
1 min readJul 24, 2020

--

I agree with Davide here.

It is the producer responsibility to define and id.

MediatR comands, when implemented in the command part, should never return a value. That's why you see the command handler in my example returning "Unit", which is basically "terminal/ignored" return type.

Now, if MediatR is used as library for request/response segregation in the "query" part of your application, then yes, a MediatR command would return something.

But perceive, there are two different concepts:

- Command, that is an imperative way to request something. In this article used to Place an Order.

- MediatR command, that is just a way of requesting something, without caring who's going to fulfill the response.

--

--

Arley Pádua
Arley Pádua

Written by Arley Pádua

Software Engineer and passionate about distributed systems

No responses yet