/// <summary> /// Deletes records in the deleteList /// </summary> public void ProcessDeletedItems() { foreach (ItemType item in _deleteList) { ActiveRecord <ItemType> .Delete(item.GetPrimaryKeyValue()); } _deleteList.Clear(); }
/// <summary> /// Finds the specified primary key value. /// </summary> /// <param name="primaryKeyValue">The primary key value.</param> /// <returns></returns> public ActiveRecord <ItemType> Find(object primaryKeyValue) { ActiveRecord <ItemType> result = null; foreach (ItemType item in this) { if (item.GetPrimaryKeyValue().Equals(primaryKeyValue)) { result = item; break; } } return(result); }
/// <summary> /// Gets the delete commands. /// </summary> /// <returns></returns> public QueryCommandCollection GetDeleteCommands() { QueryCommandCollection commands = new QueryCommandCollection(); foreach (ItemType item in _deleteList) { QueryCommand dcmd = ActiveRecord <ItemType> .GetDeleteCommand(item.GetPrimaryKeyValue()); if (dcmd != null) { commands.Add(dcmd); } } return(commands); }