Created
March 1, 2026 13:23
-
-
Save wullemsb/088f50946f2cf4404da9c0f3e3259d22 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class GetOrderParams | |
| { | |
| [FromRoute] | |
| public int OrderId { get; set; } | |
| [FromHeader(Name = "X-Tenant-Id")] | |
| public string TenantId { get; set; } = default!; | |
| [FromQuery] | |
| public bool IncludeLineItems { get; set; } | |
| } | |
| app.MapGet("/orders/{orderId}", ([AsParameters] GetOrderParams p, OrdersDb db) => | |
| { | |
| // p.OrderId — from route | |
| // p.TenantId — from request header | |
| // p.IncludeLineItems — from query string | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment