Method ConvertItems
ConvertItems<TSource, TDest>(Func<TSource, TDest?>, Func<IEnumerable<TDest>, bool>, IEnumerable<TSource>, int)
Converts items from the IEnumerable<T> specified in the
source
parameter to the destination by calling addToDest
function. Item type is converted using convertItem
function.
public static void ConvertItems<TSource, TDest>(Func<TSource, TDest?> convertItem, Func<IEnumerable<TDest>, bool> addToDest, IEnumerable<TSource> source, int bufferSize = 10)
Parameters
convertItem
Func<TSource, TDest>The function which converts item from the
TSource
type to theTDest
type. Return Null to ignore the item.addToDest
Func<IEnumerable<TDest>, bool>The function which is used to add items to the destination.
source
IEnumerable<TSource>Source of the items for the conversion.
bufferSize
intSize of the buffer for the items. Optional. Default is 10.
Type Parameters
TSource
Type of the item in the
source
.TDest
Type of the destination item.