Exemplo n.º 1
0
        public async Task <Vehicle> GetVehicle(int id)
        {
            Vehicle vehicle = null;

            try
            {
                vehicle = await vehicleRepository.Get(id);
            }
            catch (Exception ex)
            {
                logger.LogError(ex, ex.Message);
            }

            return(vehicle);
        }
Exemplo n.º 2
0
            public async Task <Result> Handle(Query query)
            {
                var data = await _repository.Get(query.VehicleID);

                if (data == null)
                {
                    return(new Result());
                }

                var result = new Result
                {
                    Id = data.Id,
                    RegistrationNumber = data.RegistrationNumber,
                    Make  = data.Make,
                    Model = data.Model
                };

                return(await Task.FromResult(result));
            }