protected override async Task <GenericResponse <List <StoreDto> > > ExecuteCore(SearchRequest request) { var stores = string.IsNullOrEmpty(request.SearchTerm) ? await storeRepository.GetAll() : await storeRepository.GetAll(request.SearchTerm?.ToLowerInvariant().Trim()); var storeDtos = stores.Select(x => x.ToDto()).ToList(); return(GenericResponse <List <StoreDto> > .AsSuccess(storeDtos)); }
protected override async Task <GenericResponse <StoreDto> > ExecuteCore(GetByGuidRequest request) { var stores = await storeRepository.FindOne(request.Id); return(GenericResponse <StoreDto> .AsSuccess(stores.ToDto())); }