src/Shared/EntityFramework/Core/Mapping/Update/Internal/Propagator.cs
// <summary>
// Performs projection for a single row. Evaluates each projection argument against the specified
// row, returning a result with the specified type.
// </summary>
// <param name="node"> Projection expression. </param>
// <param name="row"> Row to project. </param>
// <param name="resultType"> Type of the projected row. </param>
// <returns> Projected row. </returns>
Performs projection for a single row. Evaluates each projection argument against the specified
row, returning a result with the specified type.
Performs projection for a single row . Evaluates each projection argument against the specified row returning a result with the specified type .
private static PropagatorResult Project(DbProjectExpression node, PropagatorResult row, TypeUsage resultType)
        {
            DebugCheck.NotNull(node);
            DebugCheck.NotNull(node.Projection);
            var projection = node.Projection as DbNewInstanceExpression;
            if (null == projection)
            {
                throw new NotSupportedException(Strings.Update_UnsupportedProjection(node.Projection.ExpressionKind));
            }
            var projectedValues = new PropagatorResult[projection.Arguments.Count];
            for (var ordinal = 0; ordinal < projectedValues.Length; ordinal++)
            {
                projectedValues[ordinal] = Evaluator.Evaluate(projection.Arguments[ordinal], row);
            }
            var projectedRow = PropagatorResult.CreateStructuralValue(projectedValues, (StructuralType)resultType.EdmType, false);
            return projectedRow;
        }
private static PropagatorResult Project ( DbProjectExpression node , PropagatorResult row , TypeUsage resultType ) { DebugCheck . NotNull ( node ) ; DebugCheck . NotNull ( node . Projection ) ; var projection = node . Projection as DbNewInstanceExpression ; if ( null == projection ) { throw new NotSupportedException ( Strings . Update_UnsupportedProjection ( node . Projection . ExpressionKind ) ) ; } var projectedValues = new PropagatorResult [ projection . Arguments . Count ] ; for ( var ordinal = 0 ; ordinal < projectedValues . Length ; ordinal ++ ) { projectedValues [ ordinal ] = Evaluator . Evaluate ( projection . Arguments [ ordinal ] , row ) ; } var projectedRow = PropagatorResult . CreateStructuralValue ( projectedValues , ( StructuralType ) resultType . EdmType , false ) ; return projectedRow ; }
Performs projection for a single row.
Performs projection for a single row .
// Initialize empty structure containing space for every element of the projection. // Extract value from the input row for every projection argument requested. // Return a new row containing projected values.
None
node
DbProjectExpression
None
row
PropagatorResult
Row to project.
Row to project .
resultType
TypeUsage
Type of the projected row.
Type of the projected row .