public void UpdateCounter(Model.UserCounter model) { var filter = Builders <Model.UserCounter> .Filter.Eq(a => a.Id, model.Id); var modelUpdated = Builders <Model.UserCounter> .Update.Set(a => a.Counter, model.Counter + 1); _colletion.UpdateOne(filter, modelUpdated); }
public void Save(Model.UserCounter model) { _colletion.InsertOne(model); }