public async Task <bool> UpdateAsync(MongoTable data) { var filter = Builders <MongoTable> .Filter.Eq(c => c.Id, data.Id); var update = Builders <MongoTable> .Update .Set(c => c.Email, data.Email) .Set(c => c.Name, data.Name); var updated = await GetCollection().UpdateOneAsync(filter, update); return(updated.MatchedCount > 0); }
internal override void SaveUpdate(ITable table, IDynamicTableObject entity) { ((MongoTable)table).MongoCollection.ReplaceOne(MongoTable.GetIdFilter(Id), entity.obj); }
public async Task <bool> CreateAsync(MongoTable data) { await GetCollection().InsertOneAsync(data); return(true); }