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.InterfaceAssembly: 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
)
Public Shared Sub ApplySourceToDestination(Of TSource, TDest) (
source As ICollection(Of TSource),
destination As ICollection(Of TDest),
areIdentifiersEqual As Func(Of TSource, TDest, Boolean),
createDestinationRecord As Func(Of TSource, TDest),
overwriteDestinationRecord As Action(Of TSource, TDest)
)
public:
generic<typename TSource, typename TDest>
static void ApplySourceToDestination(
ICollection<TSource>^ source,
ICollection<TDest>^ destination,
Func<TSource, TDest, bool>^ areIdentifiersEqual,
Func<TSource, TDest>^ createDestinationRecord,
Action<TSource, TDest>^ overwriteDestinationRecord
)
static member ApplySourceToDestination :
source : ICollection<'TSource> *
destination : ICollection<'TDest> *
areIdentifiersEqual : Func<'TSource, 'TDest, bool> *
createDestinationRecord : Func<'TSource, 'TDest> *
overwriteDestinationRecord : Action<'TSource, 'TDest> -> unit
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