Click or drag to resize
CollectionHelperApplySourceToDestinationTSource, TDest Method
Generic (and not particularly efficient) method that takes two generic collections, where the generic types are related to each other in some way and each row has something that is unique about it, and applies add, update and delete operations to the destination so that the content matches the source.

Namespace: VirtualRadar.Interface
Assembly: VirtualRadar.Interface (in VirtualRadar.Interface.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
public static void ApplySourceToDestination<TSource, TDest>(
	ICollection<TSource> source,
	ICollection<TDest> destination,
	Func<TSource, TDest, bool> areIdentifiersEqual,
	Func<TSource, TDest> createDestinationRecord,
	Action<TSource, TDest> overwriteDestinationRecord
)

Parameters

source
Type: System.Collections.GenericICollectionTSource
The source collection.
destination
Type: System.Collections.GenericICollectionTDest
The destination collection.
areIdentifiersEqual
Type: SystemFuncTSource, TDest, Boolean
Passed a source and destination record, returns true if they have the same identifier.
createDestinationRecord
Type: SystemFuncTSource, TDest
Creates a new destination record from a source record.
overwriteDestinationRecord
Type: SystemActionTSource, TDest
Overwrites a destination record with values from a source record.

Type Parameters

TSource
TDest
See Also