Method AddElementsFrom
AddElementsFrom<T>(List<T>, List<T>, Func<T, T, bool>)
Adds elements from the specified data list to the target list based on the specified condition.
Declaration
public static void AddElementsFrom<T>(this List<T> targetList, List<T> dataList, Func<T, T, bool> condition)
Parameters
Type | Name | Description |
---|---|---|
List<T> | targetList | The list to add elements to. |
List<T> | dataList | The list of elements to add. |
Func<T, T, bool> | condition | The condition that must be satisfied for an element to be added. |
Type Parameters
Name | Description |
---|---|
T | The type of the elements in the lists. |
Remarks
This method checks each element in the data list against each element in the target list using the specified condition. If the condition is true for all elements in the target list, the data list element is added to the target list. This method does not modify the data list.