public static SimpleOperationTarget ExtendWithSelector <TSource, TResult>(this SimpleOperationTarget sourceTarget, Expression <Func <TSource, TResult> > selector) { var normalSelector = new SelectorTransformer().TransformToNormalForm(selector); var t = LambdaParametersReplacer.ReplaceLambdaParameters((LambdaExpression)normalSelector, sourceTarget.Expression); return(new SimpleOperationTarget(t, sourceTarget.RootFastCollection)); }
public static SimpleOperationTarget BuildForSelector <TSource, TResult>( [NotNull] IFastCollection <TSource> rootFastCollection, [NotNull] Expression <Func <TSource, TResult> > selector) { var normalSelector = new SelectorTransformer().TransformToNormalForm(selector); var t = LambdaParametersReplacer.ReplaceLambdaParameters((LambdaExpression)normalSelector, new FastCollectionReferenceExpression(rootFastCollection)); return(new SimpleOperationTarget(t, rootFastCollection)); }