Exemplo n.º 1
0
        public async Task <CustomerServiceResult> GetCustomerAsync(string id)
        {
            try
            {
                var entity = await _customersRepository.FindByIdAsReadableAsync(id);

                var model = entity != null
                    ? _mapper.Map(entity, new CustomerServiceResult())
                    : null;

                return(model);
            }
            catch (Exception ex)
            {
                _logger?.LogError(ex.ToString());
                throw;
            }
        }