Open
Description
Is there an existing issue for this?
- I have searched the existing issues
Is your feature request related to a problem? Please describe the problem.
I'm adding pagination support to my app. I want to avoid adding limit/offset parameters to every request, so I've added base record type PagedRequest:
public abstract record PagedReqeust
{
public int? Limit { get; init; }
public int? Offset { get; init; }
}
So I could use it like this:
public record MyRequest(string MyParam1, string MyParam2) : PagedRequest;
app
.MapGet("/my-endpoint", ([AsParameters] MyRequest request) => { /* handle it */ });
Unfortunately, it doesn't work this way. Limit
and Offset
properties stay null even when query params provided.
Describe the solution you'd like
Would be nice if [AsParameters]
taken properties into account when primary constructor is present.
Additional context
No response