示例#1
0
        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));
        }
示例#2
0
        protected override async Task <GenericResponse <StoreDto> > ExecuteCore(GetByGuidRequest request)
        {
            var stores = await storeRepository.FindOne(request.Id);

            return(GenericResponse <StoreDto> .AsSuccess(stores.ToDto()));
        }