//GetCountries
        public List <Country> GetCountries()
        {
            var dco = new DataCacheObject(DataCacheType.REFERENCE, DataCacheRegions.COUNTRIES, "GETCOUNTRIES", new object[] { },
                                          CachingExpirationTime.Days_01);
            var result = _cacheRepository.Get(dco) as List <Country>;

            if (result != null)
            {
                return(result);
            }
            result = _dataContext.spCountry_List().ToList();
            if (result.Any())
            {
                dco.Data = result;
                _cacheRepository.Add(dco);
            }
            return(result);
        }
Exemple #2
0
        //GetListPage
        public List <Country> GetCountryList()
        {
            DataCacheObject dco    = new DataCacheObject(DataCacheType.REFERENCE, DataCacheRegions.COUNTRIES, "GETCOUNTRYLIST", new object[] { }, CachingExpirationTime.Days_01);
            List <Country>  result = CacheRepository.Get(dco) as List <Country>;

            if (result != null && result.Count() > 0)
            {
                return(result);
            }
            result = dataContext.spCountry_List().ToList();
            if (result.Count() > 0)
            {
                dco.Data = result;
                CacheRepository.Add(dco);
            }
            return(result);
        }