Using MediatR in ASP.NET Core. I have a Command for editing a user. One of the properties in the Command is based on a SelectList
Dropdown that has values pulled from a DB.
Just curious, what do people normally do for that? Do you put the SelectList
or IEnumerable<T>
as part of the Command? That seems wrong, because it's not really part of the Command.... but I want the Controller to be clean and just have mediator.Send calls in the Controller and handling responses. I don't really want to have to make a DB call outside of the Handler on the GET and on the POST (if validation fails for instance).
I'm curious what do people do in scenarios like this where you have non-editable data that is related but not part of your Command? I haven't really seen any MediatR examples that cover a scenario like this.