Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
0
        // 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);
        }