public new bool[] PutMany(
            QueryKey[] keys,
            QueryParameters[] queryParameters,
            ICacheAssembler[][] returnTypes,
            IList[] results,
            ISessionImplementor session)
        {
            if (Log.IsDebugEnabled())
            {
                Log.Debug(
                    "caching query results in region: '{0}'; {1}",
                    RegionName,
                    StringHelper.CollectionToString(keys));
            }

            var cached = new bool[keys.Length];

            var ts = session.Factory.Settings.CacheProvider.NextTimestamp();

            var cachedKeys = new List <object>();

            var cachedResults = new List <object>();

            for (var i = 0; i < keys.Length; i++)
            {
                var result = results[i];
                if (queryParameters[i].NaturalKeyLookup &&
                    result.Count == 0)
                {
                    continue;
                }

                cached[i] = true;
                cachedKeys.Add(keys[i]);

                cachedResults.Add(
                    GetCacheableResult(
                        returnTypes[i],
                        session,
                        result,
                        ts));
            }

            var queryDependencies =
                NCacheProvider.GetQueryDependencyConfigs(_ncacheClient.RegionPrefix);

            _ncacheClient.PutMany(
                cachedKeys.ToArray(),
                cachedResults.ToArray(),
                session,
                queryDependencies);

            return(cached);
        }
        public new async Task <bool> PutAsync(
            QueryKey key,
            QueryParameters queryParameters,
            ICacheAssembler[] returnTypes,
            IList result,
            ISessionImplementor session,
            CancellationToken cancellationToken)
        {
            cancellationToken.ThrowIfCancellationRequested();

            if (queryParameters.NaturalKeyLookup &&
                result.Count == 0)
            {
                return(false);
            }

            var ts = session.Factory.Settings.CacheProvider.NextTimestamp();

            if (Log.IsDebugEnabled())
            {
                Log.Debug(
                    "caching query results in region: '{0}'; {1}",
                    RegionName,
                    key);
            }

            var value = await GetCacheableResultAsync(
                returnTypes,
                session,
                result,
                ts,
                cancellationToken)
                        .ConfigureAwait(false);

            var queryDependencies =
                NCacheProvider.GetQueryDependencyConfigs(_ncacheClient.RegionPrefix);

            await _ncacheClient.PutAsync(
                key,
                value,
                session,
                queryDependencies,
                cancellationToken)
            .ConfigureAwait(false);

            return(true);
        }
        public new bool Put(
            QueryKey key,
            QueryParameters queryParameters,
            ICacheAssembler[] returnTypes,
            IList result,
            ISessionImplementor session)
        {
            if (queryParameters.NaturalKeyLookup &&
                result.Count == 0)
            {
                return(false);
            }

            var ts = session.Factory.Settings.CacheProvider.NextTimestamp();

            if (Log.IsDebugEnabled())
            {
                Log.Debug(
                    "caching query results in region: '{0}'; {1}",
                    RegionName,
                    key);
            }

            var queryDependencies =
                NCacheProvider.GetQueryDependencyConfigs(_ncacheClient.RegionPrefix);

            _ncacheClient.Put(
                key,
                GetCacheableResult(
                    returnTypes,
                    session,
                    result,
                    ts),
                session,
                queryDependencies);

            return(true);
        }