/// <summary> /// Updates the specified Key. /// </summary> /// <param name="connectorEntity">The ConnectorEntity to update.</param> /// <returns></returns> public Task <bool> UpdateAsync(LiteDbConnectorEntity connectorEntity) { // LiteDb library does not implement asynchronous operations yet var update = Update(connectorEntity); return(Task.FromResult(update)); }
/// <summary> /// Set the Key to hold the value. /// </summary> /// <param name="connectorEntity">The ConnectorEntity to store.</param> /// <returns></returns> public Task <bool> InsertAsync(LiteDbConnectorEntity connectorEntity) { // LiteDb library does not implement asynchronous operations Delete(connectorEntity.Key); var insert = Insert(connectorEntity); return(Task.FromResult(insert)); }
/// <summary> /// Set the Key to hold the value. /// </summary> /// <param name="connectorEntity">The ConnectorEntity to store.</param> /// <returns></returns> public bool Insert(LiteDbConnectorEntity connectorEntity) { var result = _liteDbAccess.Collection.Insert(connectorEntity); return(!result.IsNull); }
/// <summary> /// Updates the specified Key. /// </summary> /// <param name="connectorEntity">The ConnectorEntity to update.</param> /// <returns></returns> public bool Update(LiteDbConnectorEntity connectorEntity) { // TODO switch to single access with UpdateMany _liteDbAccess.Collection.DeleteMany(Query.EQ("Key", new BsonValue(connectorEntity.Key))); return(Insert(connectorEntity)); }