コード例 #1
0
        public IDataResult <List <Supplier> > GetAllAsync(Expression <Func <Supplier, bool> > filter = null)
        {
            var _getAllAsync = _supplierDal.GetAllAsync(filter).Result;

            if (_getAllAsync == null)
            {
                return(new ErrorDataResult <List <Supplier> >(SupplierMessages.RecordNotFound));
            }
            return(new SuccessDataResult <List <Supplier> >(_getAllAsync, SupplierMessages.SuppliersListed));
        }
コード例 #2
0
        public async Task <List <Supplier> > GetAllAsync(Expression <Func <Supplier, bool> > filter = null)
        {
            var cancelToken = new CancellationTokenSource();

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