示例#1
0
        public ProfileCache GetProfileByID(string id)
        {
            int profileID = -1;

            if (!Int32.TryParse(id, out profileID))
            {
                Log.Error("Could not parse id.");
                return(null);
            }

            ICacheContent profileCache = this.Get(profileID);

            if (profileCache == null)
            {
                Log.Error("Cache did not retrieve any cacheContent.");
                return(null);
            }

            ProfileCache profileCacheObj = profileCache as ProfileCache;

            if (profileCacheObj == null)
            {
                Log.Error("CacheObject could not be passed into ProfileCache");
                return(null);
            }

            return(profileCacheObj);
        }
示例#2
0
        public FileResult Default(int contentID)
        {
            ICacheContent content = this.MobiContext.Service.Cache.Get(contentID);

            if (content == null)
            {
                return(null);
            }

            return(File(content.DefaultThumbnail as byte[], "image/jpg", string.Format("{0}{1}", contentID, ".jpg")));
        }
示例#3
0
 public ExpiredEventArgs(ICacheContent <TKey, TContent> content)
 {
     Content = content;
 }