simplesoft-pt / Mediator

Small .NET library that helps with the implementation of mediator pattern for commands, events and queries
MIT License
41 stars 9 forks source link

Extremely simple example creating and handling a command #11

Closed manuelconesa closed 3 years ago

manuelconesa commented 3 years ago

Hi.

I would really love to implement mediator in my project. I have read your documentation and seems almost complete.

The only thing remaining would be a very simple piece of code creating a mediator, a command handler and sending a command from Main() .

That would be extremely helpful. If you do so, I promise to publish a tutorial using your nuget package.

:)

gravity00 commented 3 years ago

I'll create an example soon, now that you requested it, probably this week or so.

manuelconesa commented 3 years ago

That would be awesome. Honestly, I believe that kind of example is the only piece remaining for this component to be much more widely adopted by many developers. Seems a lightweight alternative to some other mediator frameworks which are literally overkill...

gravity00 commented 3 years ago

Just created an ASP.NET Core API into the work folder that exemplifies the usage of commands and queries, with logging, validation and EF Core transaction pipeline, I believe it should be enough for what you asked?

https://github.com/simplesoft-pt/Mediator/tree/master/work/SimpleSoft.Mediator.Example.Api

manuelconesa commented 3 years ago

OMG!

Thank you so much. It´s not exactly what I would consider an extremely simple example. (I was expecting something like a c# project sending messages in command line like "Hello. I am a command sent". "hello. I have validated the command", "hello, I am a message received" and "hi from the pipeline" to start with :))

But I am now playing with its swagger interface.

Thanks for your huge effort!

gravity00 commented 3 years ago

Ah, for that I already provided a console application: https://github.com/simplesoft-pt/Mediator/tree/master/work But I already wanted to create a simple API so, this was a nice request!