namespace TestWeb.Core.Vehicles; using Infra; public static class GetVehicleEndpoint { public static async Task, 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); } }