Beispiel #1
0
        public IActionResult Get(string id)
        {
            var vehicle = db.FindVehicle(id);

            if (vehicle == default)
            {
                return(NotFound($"Sorry, there's no car with registration {id} in our system."));
            }
            var result = vehicle.ToResource();

            return(Ok(result));
        }
Beispiel #2
0
        public IActionResult Details(string id)
        {
            var vehicle = db.FindVehicle(id);

            return(View(vehicle));
        }
 public Vehicle Get(string id)
 {
     return(db.FindVehicle(id));
 }