Example #1
0
        public List <ListarUbigeoDto> GetListarUbigeo_Cache()
        {
            var ubigeo = HttpContext.Cache.Get("Ubigeo") as List <ListarUbigeoDto>;

            if (HttpContext.Cache["Ubigeo"] == null)
            {
                ubigeo = MantenimientoData.GetListarUbigeo();
                HttpContext.Cache.Insert("Ubigeo", ubigeo, null, DateTime.Now.AddSeconds(1500), Cache.NoSlidingExpiration);
            }
            else
            {
                ubigeo = (List <ListarUbigeoDto>)HttpContext.Cache["Ubigeo"];
            }

            return(ubigeo);
        }