Esempio n. 1
0
        public as_statuses GetStatus(int id)
        {
            var res = new as_statuses();
            var key = "as_statuses_id_" + id.ToString();

            if (CacheManager.EnableCaching && CacheManager.Cache[key] != null)
            {
                res = (as_statuses)CacheManager.Cache[key];
            }
            else
            {
                try
                {
                    res = db.GetStatusById(id);
                    CacheManager.CacheData(key, res);
                }
                catch (Exception ex)
                {
                    Debug.LogError(ex);
                }
            }
            return(res);
        }