public IActionResult Post([FromBody] Rent rent) { if (!rentService.CanRent(rent.VehicleId)) { return(BadRequest()); } rentService.Rent(rent); return(CreatedAtRoute("GetRent", new { id = rent.Id }, rent)); }