protected async Task SaveAsync(Scope scope)
 {
     BsonDocument doc = new ScopeSerializer().Serialize(scope);
     IMongoCollection<BsonDocument> collection = _data.Database.GetCollection<BsonDocument>(Settings.ScopeCollection);
     var result = await collection.ReplaceOneAsync(
         Filter.ById(scope.Name),
         doc,
         PerformUpsert
         ).ConfigureAwait(false);
     Debug.WriteLine(result);
 }
Пример #2
0
 public ScopeStore(IMongoDatabase db, StoreSettings settings) :
     base(db, settings.ScopeCollection)
 {
     _serializer = new ScopeSerializer();
 }
 public ScopeStore(IMongoDatabase db, StoreSettings settings) :
     base(db, settings.ScopeCollection)
 {
     _serializer = new ScopeSerializer();
 }