public async Task <IActionResult> GetCurrent(int id, CancellationToken ct = default(CancellationToken)) { try { var userId = int.Parse(((ClaimsIdentity)User.Identity).Name); if (!await _vehicleManager.isValidUserVehicle(userId, id, ct)) { return(Forbid()); } var vehicle = await _manager.GetLocationByVehicleIdAsync(id, ct); if (vehicle == null) { return(NotFound()); } return(Ok(vehicle)); } catch (Exception ex) { return(StatusCode(500, new { Code = "ServerError", ex.Message })); } }