public void Update(ObjectId id, BietDuocHoaChat p) { p.Id = id; var res = Query <BietDuocHoaChat> .EQ(pd => pd.Id, id); var operation = Update <BietDuocHoaChat> .Replace(p); _db.GetCollection <BietDuocHoaChat>("bietduochoatchats").Update(res, operation); }
public BietDuocHoaChat Create(BietDuocHoaChat p) { _db.GetCollection <BietDuocHoaChat>("bietduochoatchats").Save(p); return(p); }