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)); }
public async Task <IEnumerable <DriverDto> > BrowseAsync() { IEnumerable <Driver> drivers = await driverRepository.BrowseAsync(); return(mapper.Map <IEnumerable <Driver>, IEnumerable <DriverDto> >(drivers)); }