Watch
1
0
Fork
You've already forked test-web
0

Initial commit
All checks were successful
Build / build (push) Successful in 43s

This commit is contained in:
Chris 2026-06-06 10:39:37 +01:00
commit 1199bef0c8

View file

@ -0,0 +1,20 @@
namespace TestWeb.Core.Vehicles;
using Infra;
public static class GetVehicleEndpoint
{
public static async Task<Results<Ok<Vehicle>, NotFound>> Handle(
int id,
AppDbContext db,
CancellationToken ct)
{
var result = await db.Vehicles
.Where(x => x.Id == id)
.SingleOrDefaultAsync(ct);
return result is null
? TypedResults.NotFound()
: TypedResults.Ok(result);
}
}