Exemplo n.º 1
0
        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);
        }
Exemplo n.º 2
0
 internal override void SaveUpdate(ITable table, IDynamicTableObject entity)
 {
     ((MongoTable)table).MongoCollection.ReplaceOne(MongoTable.GetIdFilter(Id), entity.obj);
 }
Exemplo n.º 3
0
        public async Task <bool> CreateAsync(MongoTable data)
        {
            await GetCollection().InsertOneAsync(data);

            return(true);
        }