public IDataResult <List <Territory> > GetAllAsync(Expression <Func <Territory, bool> > filter = null)
        {
            var _getAllAsync = _territoryDal.GetAllAsync(filter).Result;

            if (_getAllAsync == null)
            {
                return(new ErrorDataResult <List <Territory> >(TerritoryMessages.RecordNotFound));
            }
            return(new SuccessDataResult <List <Territory> >(_getAllAsync, TerritoryMessages.TerritoriesListed));
        }
        public async Task <List <Territory> > GetAllAsync(Expression <Func <Territory, bool> > filter = null)
        {
            var cancelToken = new CancellationTokenSource();

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