コード例 #1
0
 public Task UpsertAsync(string key, MongoCacheItem cacheItem, CancellationToken token)
 {
     return(_mongoCollection.ReplaceOneAsync(getQuery(key).Filter, cacheItem, new UpdateOptions {
         IsUpsert = true
     }, token));
 }
コード例 #2
0
 public void Upsert(string key, MongoCacheItem cacheItem)
 {
     _mongoCollection.ReplaceOne(getQuery(key).Filter, cacheItem, new UpdateOptions {
         IsUpsert = true
     });
 }