Пример #1
0
        public async Task <IEnumerable <DriverDto> > BrowseAsync()
        {
            var drivers = await _driverRepository.BrowseAsync();

            if (drivers == null)
            {
                throw new ServiceException(ErrorCodes.DriverNotFound, "Drivers not exist");
            }

            return(_mapper.Map <IEnumerable <Driver>, IEnumerable <DriverDto> >(drivers));
        }
Пример #2
0
        public async Task <IEnumerable <DriverDto> > BrowseAsync()
        {
            IEnumerable <Driver> drivers = await driverRepository.BrowseAsync();

            return(mapper.Map <IEnumerable <Driver>, IEnumerable <DriverDto> >(drivers));
        }