示例#1
0
        internal void InsertBulk(object[] keys, CacheItem[] values)
        {
            Logger.Log(
                "Inserting items in bulk against respective keys.",
                Microsoft.Extensions.Logging.LogLevel.Trace
                );
            if (keys.Length > 0)
            {
                string[] strKeys = new string[keys.Length];
                for (int i = 0; i < keys.Length; i++)
                {
                    strKeys[i] = keys[i].ToString();
                }
                IDictionary issues = _nCache.InsertBulk(strKeys, values);
                if (issues.Count > 0)
                {
                    _nCache.RemoveBulk(strKeys);

                    IDictionaryEnumerator enumerator = issues.GetEnumerator();
                    enumerator.MoveNext();
                    throw (Exception)enumerator.Entry.Value;
                }
            }
        }