public async Task <CarRead> GetCar(string id) { var car = _dataAccess.GetCar(new Guid(id)); if (car.Locked) { if (CarHasBeenLocked40Seconds(car)) { //Lock timed out and can be ignored and set to false var updateCarLockedStatus = new UpdateCarLockedStatus { LockedStatus = false, CarId = car.CarId, CompanyId = car.CompanyId, UpdateCarLockedTimeStamp = DateTime.Now.Ticks }; await _endpointInstancePriority.Publish(updateCarLockedStatus).ConfigureAwait(false); } } var CarRead = new CarRead(car.CarId) { CompanyId = car.CompanyId, CreationTime = car.CreationTime, Locked = car.Locked, Online = car.Online, Speed = car.Speed, RegNr = car.RegNr, VIN = car.VIN }; return(CarRead); }
CarRead GetCar(string id) { return(_dataAccessRead.GetCar(new Guid(id))); }