public DataContainerCollection GetDifference(DataContainerCollection dataContainers) { ArgumentUtility.CheckNotNull("dataContainers", dataContainers); DataContainerCollection difference = new DataContainerCollection(); foreach (DataContainer dataContainer in this) { if (!dataContainers.Contains(dataContainer.ID)) { difference.Add(dataContainer); } } return(difference); }
// types // static members and constants public static DataContainerCollection Join(DataContainerCollection firstCollection, DataContainerCollection secondCollection) { ArgumentUtility.CheckNotNull("firstCollection", firstCollection); ArgumentUtility.CheckNotNull("secondCollection", secondCollection); DataContainerCollection joinedCollection = new DataContainerCollection(firstCollection, false); foreach (DataContainer dataContainer in secondCollection) { if (!joinedCollection.Contains(dataContainer.ID)) { joinedCollection.Add(dataContainer); } } return(joinedCollection); }
public DataContainerCollection Merge(DataContainerCollection dataContainers) { ArgumentUtility.CheckNotNull("dataContainers", dataContainers); DataContainerCollection mergedCollection = new DataContainerCollection(); foreach (DataContainer dataContainer in this) { if (dataContainers.Contains(dataContainer.ID)) { mergedCollection.Add(dataContainers[dataContainer.ID]); } else { mergedCollection.Add(dataContainer); } } return(mergedCollection); }