0

I am a new at MediatR user of .net core platform. And I read that is a nice solution to implement CQRS pattern. So my project does not use any database. And it dows only query from Elasticsearch. So Can I use MediatR in this project and is it make sense?

barteloma
  • 6,403
  • 14
  • 79
  • 173

1 Answers1

0

Actually when Database does not exists in solution it is not affected to MediatR and CQRS, because Database it is just a way to store you data (it can be simple List for example instead). MediatR with IRequest and IRequestHandler gives you another layer between view and domain. So answer is: yes you can use MediatR library/pattern in your solution.

Simple advice: NO complex logic in your controller methods. MediatR can help with this

IKomarovLeonid
  • 352
  • 1
  • 9