MediatR and CQRS for basic logic
So started doing abit of MediatR CQRS pattern in abit of Clean Architecture. I've been doing the Query and Commands for Database / API stuff as the articles suggest but what about general business logic?
Say I have a List of People and I want to capitalize all their Surnames right so Wibbly Wobbly becomes Wibbly WOBBLY and find people aged 30 and above.
Would it be:
Nothing fancy but using
or:
As you might find with most stuff.
In other words, should you use it for the majority of logic or just API/Database stuff.
Say I have a List of People and I want to capitalize all their Surnames right so Wibbly Wobbly becomes Wibbly WOBBLY and find people aged 30 and above.
Would it be:
ToCapitalSurnameAndOver30 simply takes a list foreach person in people, gets the surname ToUpperCase() and if (person.Age > 30) add to another list maybe.Nothing fancy but using
_mediator.Send() to get to this logicor:
As you might find with most stuff.
In other words, should you use it for the majority of logic or just API/Database stuff.