コード例 #1
0
        public static void Set(object objToWrite, string key, int?cacheDurationSeconds = null)
        {
            try
            {
                //add to mem cache
                ObjectCache.AddItem(objToWrite, key, cacheDurationSeconds);

                //write to the file system
                //(also writes to object cache)
                FileCache.AddItem(objToWrite, key, cacheDurationSeconds);

                //Is Azure Setup?
                if (Azure.IsReady)
                {
                    //writes to azure blob storage
                    //(also writes to file cache)
                    //(also writes to object cache)
                    Azure.AddItem(objToWrite, key);
                }
                //TODO: else if (AmazonS3.IsReady)
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }