Get a resource by id
The default read endpoint: return the resource, or 404 when it does not exist.
app.MapGet("/products/{id:int}", async Task<Results<Ok<ProductDto>, NotFound>> (
int id, IProductRepo repo, CancellationToken ct) =>
{
var product = await repo.FindAsync(id, ct);
return product is null
? TypedResults.NotFound()
: TypedResults.Ok(product.ToDto());
});