Exemplo n.º 1
0
        public IDataResult <List <Category> > GetAllAsync(Expression <Func <Category, bool> > filter = null)
        {
            var _getAllAsync = _categoryDal.GetAllAsync(filter).Result;

            if (_getAllAsync == null)
            {
                return(new ErrorDataResult <List <Category> >(CategoryMessages.RecordNotFound));
            }
            return(new SuccessDataResult <List <Category> >(_getAllAsync, CategoryMessages.CategoryListed));
        }
Exemplo n.º 2
0
 public async Task <IDataResult <List <Category> > > GetAll()
 {
     return(new SuccessDataResult <List <Category> >(await _categoryDal.GetAllAsync()));
 }
Exemplo n.º 3
0
        public async Task <IDataResult <List <Category> > > GetAllAsync()
        {
            var result = await _categoryDal.GetAllAsync();

            return(new SuccessDataResult <List <Category> >(result, Messages.Category.GetAllSuccess));
        }
        public async Task <List <Category> > GetAllAsync(Expression <Func <Category, bool> > filter = null)
        {
            var cancelToken = new CancellationTokenSource();

            return(await _categoryDal.GetAllAsync(cancelToken.Token, filter));
        }