Click or drag to resize

LinqUtilsMergeProjectionAdjustmentsIntoProjectionTFunc Method

Merges the source expression into the destination expression. This is used for projections in the form of a func, to adjust the projection func represented by destination with the expressions in source. The method expects a MemberInitExpression as the body of the lambda for destination and source. the Bindings of the MemberInitExpression in source are then migrated to the Bindings section of the MemberInitExpression of destination. Each binding is a MemberAssignment expression, referring to a member in TTarget and an expression using a parameter representing TSource. The expression can be a MemberAccessExpression or other. If requested, we have to replace the parameter object in the source memberassignment's expressions with the parameter from destination. This is the case in Linq queries, but not in queryspec queries If a binding in source refers to the same member as a binding in destination, it replaces the binding in destination.

Namespace:  SD.LLBLGen.Pro.LinqSupportClasses
Assembly:  SD.LLBLGen.Pro.ORMSupportClasses (in SD.LLBLGen.Pro.ORMSupportClasses.dll) Version: 5.9.0.0 (5.9.0)
Syntax
public static Expression<TFunc> MergeProjectionAdjustmentsIntoProjection<TFunc>(
	Expression<TFunc> destination,
	Expression<TFunc> source,
	bool migrateParameter
)

Parameters

destination
Type: System.Linq.ExpressionsExpressionTFunc
The lambda to merge source into
source
Type: System.Linq.ExpressionsExpressionTFunc
the lambda from which the first new expression's member expressions are migrated from, into the first new expression of destination.
migrateParameter
Type: SystemBoolean
If true, it'll migrate the source parameter in the bindings to the destination parameter.

Type Parameters

TFunc
The type of the func used to project a source to destination

Return Value

Type: ExpressionTFunc
See Also