コード例 #1
0
        public IDataResult <Territory> GetAsync(Expression <Func <Territory, bool> > filter)
        {
            var _getAsync = _territoryDal.GetAsync(filter).Result;

            if (_getAsync == null)
            {
                return(new ErrorDataResult <Territory>(TerritoryMessages.RecordNotFound));
            }
            return(new SuccessDataResult <Territory>(_getAsync, TerritoryMessages.TerritoryListed));
        }
コード例 #2
0
        public async Task <Territory> GetAsync(Expression <Func <Territory, bool> > filter)
        {
            var cancelToken = new CancellationTokenSource();

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