/// <summary>
 /// Removes the name of an index from the cache.
 /// </summary>
 /// <param name="collection">The collection that contains the index.</param>
 /// <param name="indexName">The name of the index.</param>
 public void Remove(MongoCollection collection, string indexName)
 {
     lock (_syncRoot)
     {
         var database = collection.Database;
         var key = new IndexCacheKey(database.Name, collection.Name, indexName);
         _cache.Remove(key);
     }
 }
 /// <summary>
 /// Tests whether the cache contains the name of an index.
 /// </summary>
 /// <param name="collection">The collection that contains the index.</param>
 /// <param name="indexName">The name of the index.</param>
 /// <returns>True if the cache contains the named index.</returns>
 public bool Contains(MongoCollection collection, string indexName)
 {
     lock (_syncRoot)
     {
         var database = collection.Database;
         var key = new IndexCacheKey(database.Name, collection.Name, indexName);
         return _cache.Contains(key);
     }
 }
 /// <summary>
 /// Removes the name of an index from the cache.
 /// </summary>
 /// <param name="collection">The collection that contains the index.</param>
 /// <param name="indexName">The name of the index.</param>
 public void Remove(MongoCollection collection, string indexName)
 {
     lock (syncRoot)
     {
         var database = collection.Database;
         var key      = new IndexCacheKey(database.Name, collection.Name, indexName);
         cache.Remove(key);
     }
 }
 /// <summary>
 /// Tests whether the cache contains the name of an index.
 /// </summary>
 /// <param name="collection">The collection that contains the index.</param>
 /// <param name="indexName">The name of the index.</param>
 /// <returns>True if the cache contains the named index.</returns>
 public bool Contains(MongoCollection collection, string indexName)
 {
     lock (syncRoot)
     {
         var database = collection.Database;
         var key      = new IndexCacheKey(database.Name, collection.Name, indexName);
         return(cache.Contains(key));
     }
 }
Beispiel #5
0
 // public methods
 /// <summary>
 /// Adds the name of an index to the cache.
 /// </summary>
 /// <param name="collection">The collection that contains the index.</param>
 /// <param name="indexName">The name of the index.</param>
 public void Add(MongoCollection collection, string indexName)
 {
     lock (_syncRoot)
     {
         var database = collection.Database;
         var key      = new IndexCacheKey(database.Name, collection.Name, indexName);
         _cache.Add(key);
     }
 }
 /// <summary>
 /// Adds the name of an index to the cache.
 /// </summary>
 /// <param name="collection">The collection that contains the index.</param>
 /// <param name="indexName">The name of the index.</param>
 public void Add(
     MongoCollection collection,
     string indexName
 ) {
     lock (syncRoot) {
         var database = collection.Database;
         var key = new IndexCacheKey(database.Name, collection.Name, indexName);
         cache.Add(key);
     }
 }