alindgren / Fundraise

A .NET core library for building fundraising applications
MIT License
17 stars 11 forks source link

Create thin controllers using command pattern and MediatR #11

Closed alindgren closed 6 years ago

alindgren commented 6 years ago

See https://jonhilton.net/2016/06/06/simplify-your-controllers-with-the-command-pattern-and-mediatr/

alindgren commented 6 years ago

Start with the Donate form: https://github.com/alindgren/Fundraise/blob/0436119cce0eed101bc5220b606fba997dbc3438/Fundraise.MvcExample/Controllers/FundraiserController.cs#L66-L92

alindgren commented 6 years ago

See also https://jonhilton.net/2016/08/31/how-to-easily-extend-your-app-using-mediatr-notifications/

if you use MediatR in the first place, switching to a messaging/queuing approach is a simple exercise.

alindgren commented 6 years ago

All the controllers in the example MVC site now use mediator to access the Fundraise repositories.