Ejemplo n.º 1
0
        public IDeviceMapper SetFavourite(ObjectId deviceId, bool isFavourite)
        {
            FilterDefinition <BsonDocument> filterDefinition = Builders <BsonDocument> .Filter.Eq("_id", deviceId);

            UpdateDefinition <BsonDocument>
            updateDefinition = Builders <BsonDocument> .Update.Set("IsFavourite", isFavourite);

            Uow.RegisterDirty(CollectionName, filterDefinition, updateDefinition);
            return(this);
        }
Ejemplo n.º 2
0
        public IHouseholdMapper ResetPassword(string username, string password)
        {
            FilterDefinition <BsonDocument> filterDefinition = Builders <BsonDocument> .Filter.Eq("Username", username);

            UpdateDefinition <BsonDocument>
            updateDefinition = Builders <BsonDocument> .Update.Set("Password", password);

            Uow.RegisterDirty(CollectionName, filterDefinition, updateDefinition);
            return(this);
        }
 public IBaseMapper <T> Update(T obj)
 {
     AddToBsonClassMap(obj);
     Uow.RegisterDirty(CollectionName, Builders <BsonDocument> .Filter.Eq("_id", obj._id), obj.ToBsonDocument());
     return(this);
 }