Example #1
0
		internal void Put(string cacheId, string key, object value, CachePutOptions options)
		{
			Platform.CheckForNullReference(key, "key");
			Platform.CheckForNullReference(value, "value");
			Platform.CheckForNullReference(options, "options");

			// ensure region exists
			CreateRegion(cacheId, options.Region);

			var cacheKey = GetItemCacheKey(cacheId, options.Region, key);
			PutItem(cacheKey, key, GetRegionCacheKey(cacheId, options.Region),
				value, options.Expiration, options.Sliding);
		}
        internal void Put(string cacheId, string key, object value, CachePutOptions options)
        {
            Platform.CheckForNullReference(key, "key");
            Platform.CheckForNullReference(value, "value");
            Platform.CheckForNullReference(options, "options");

            // ensure region exists
            CreateRegion(cacheId, options.Region);

            var cacheKey = GetItemCacheKey(cacheId, options.Region, key);

            PutItem(cacheKey, key, GetRegionCacheKey(cacheId, options.Region),
                    value, options.Expiration, options.Sliding);
        }
			public void Put(string key, object value, CachePutOptions options)
			{
				Platform.CheckForNullReference(key, "key");
				Platform.CheckForNullReference(value, "value");
				Platform.CheckForNullReference(options, "options");

				var policy = new CacheItemPolicy();
				if (options.Sliding)
				{
					policy.SlidingExpiration = options.Expiration;
				}
				else
				{
					policy.AbsoluteExpiration = DateTimeOffset.Now + options.Expiration;
				}

				_logicalCache.GetRegion(options.Region).Set(key, value, policy);
			}
            public void Put(string key, object value, CachePutOptions options)
            {
                Platform.CheckForNullReference(key, "key");
                Platform.CheckForNullReference(value, "value");
                Platform.CheckForNullReference(options, "options");

                var policy = new CacheItemPolicy();

                if (options.Sliding)
                {
                    policy.SlidingExpiration = options.Expiration;
                }
                else
                {
                    policy.AbsoluteExpiration = DateTimeOffset.Now + options.Expiration;
                }

                _logicalCache.GetRegion(options.Region).Set(key, value, policy);
            }
			public void Put(string key, object value, CachePutOptions options)
			{
				_cache[key] = new ValueOptionsPair { Value = value, Options = options };
			}