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); }
public ScopeStore(IMongoDatabase db, StoreSettings settings) : base(db, settings.ScopeCollection) { _serializer = new ScopeSerializer(); }