I am trying to implement a simple generic minimal API MediatR method mapper (inspired by this video).
I ran into an issue regarding mapping my request model when receiving data from body in the POST method with AsParametersAttribute
.
I've double checked in documentation that this is possible, but...
- Using AsParametersAttribute I don't get any data in the model
- Using FromBodyAttribute I get the data in the model as expected.
- SignInRequest is a simple model which I've tried to convert to everything -
class
,record struct
. It doesn't work with[AsParameters]
. TheIHttpRequest
is just simplification of MediatR'sIResult<TResponse>
with my custom response model.