示例#1
0
        public IDataResult <Order> GetAsync(Expression <Func <Order, bool> > filter)
        {
            var _getAsync = _orderDal.GetAsync(filter).Result;

            if (_getAsync == null)
            {
                return(new ErrorDataResult <Order>(OrderMessages.RecordNotFound));
            }
            return(new SuccessDataResult <Order>(_getAsync, OrderMessages.OrderListed));
        }
        public async Task <Order> GetAsync(Expression <Func <Order, bool> > filter)
        {
            var cancelToken = new CancellationTokenSource();

            return(await _orderDal.GetAsync(filter, cancelToken.Token));
        }