src/Shared/EntityFramework/Core/Mapping/Update/Internal/Propagator.Evaluator.cs
// <summary>
// Evaluates treat expression given a result for the argument to the treat.
// </summary>
// <param name="node"> Treat expression </param>
// <returns> Null if the argument is of the given type, the argument otherwise </returns>
Evaluates treat expression given a result for the argument to the treat.
Evaluates treat expression given a result for the argument to the treat .
public override PropagatorResult Visit(DbTreatExpression node)
            {
                Check.NotNull(node, "node");
                var childResult = Visit(node.Argument);
                var nodeType = node.ResultType;
                if (MetadataHelper.IsSuperTypeOf(nodeType.EdmType, childResult.StructuralType))
                {
                    return childResult;
                }
                var result = PropagatorResult.CreateSimpleValue(childResult.PropagatorFlags, null);
                return result;
            }
public override PropagatorResult Visit ( DbTreatExpression node ) { Check . NotNull ( node , " " ) ; var childResult = Visit ( node . Argument ) ; var nodeType = node . ResultType ; if ( MetadataHelper . IsSuperTypeOf ( nodeType . EdmType , childResult . StructuralType ) ) { return childResult ; } var result = PropagatorResult . CreateSimpleValue ( childResult . PropagatorFlags , null ) ; return result ; }
Evaluates treat expression given a result for the argument to the treat.
Evaluates treat expression given a result for the argument to the treat .
// Doing an up cast is not required because all property/ordinal // accesses are unaffected for more derived types (derived members // are appended) // "Treat" where the result does not implement the given type results in a null // result
Null if the argument is of the given type, the argument otherwise
Null if the argument is of the given type the argument otherwise
node
DbTreatExpression
None