Poll Results : Do you put MediatR command/query and related handler in same file?

Personally I think MediatR can add unneeded complexity to a project but when using it one thing I like to do is keep the command/query and its related handler in the same file. Perhaps not one for the purists but for me this makes it a little easier to work with.

I was curious what other devs did so ran a poll on my LinkedIn and Twitter pages.

Most devs seem to go with the approach of keeping the command/query and its handler in different files, although on Twitter the results were pretty close.

What do you like to do? Same file or different files?

Leave a Reply

Your email address will not be published. Required fields are marked *