src/Shared/EntityFramework/Core/Mapping/Update/Internal/Propagator.cs
// <summary>
// Given the results returned for the left and right inputs to a union, propagates changes
// through the union.
// Propagation rule (U = union node, L = left input, R = right input, D(x) = deleted rows
// in x, I(x) = inserted rows in x)
// U = L union R
// D(U) = D(L) union D(R)
// I(U) = I(L) union I(R)
// </summary>
// <param name="node"> Union expression node in the update mapping view. </param>
// <returns> Result of propagating changes to this union all node. </returns>
Given the results returned for the left and right inputs to a union, propagates changes
through the union.
Given the results returned for the left and right inputs to a union propagates changes through the union .
public override ChangeNode Visit(DbUnionAllExpression node)
        {
            Check.NotNull(node, "node");
            var result = BuildChangeNode(node);
            var left = Visit(node.Left);
            var right = Visit(node.Right);
            result.Inserted.AddRange(left.Inserted);
            result.Inserted.AddRange(right.Inserted);
            result.Deleted.AddRange(left.Deleted);
            result.Deleted.AddRange(right.Deleted);
            result.Placeholder = left.Placeholder;
            return result;
        }
public override ChangeNode Visit ( DbUnionAllExpression node ) { Check . NotNull ( node , " " ) ; var result = BuildChangeNode ( node ) ; var left = Visit ( node . Left ) ; var right = Visit ( node . Right ) ; result . Inserted . AddRange ( left . Inserted ) ; result . Inserted . AddRange ( right . Inserted ) ; result . Deleted . AddRange ( left . Deleted ) ; result . Deleted . AddRange ( right . Deleted ) ; result . Placeholder = left . Placeholder ; return result ; }
Given the results returned for the left and right inputs to a union, propagates changes
through the union.
Given the results returned for the left and right inputs to a union propagates changes through the union .
// Initialize an empty change node result for the union all node // Retrieve result of propagating changes to the left and right children. // Implement insertion propagation rule I(U) = I(L) union I(R) // Implement deletion progation rule D(U) = D(L) union D(R) // The choice of side for the placeholder is arbitrary, since CQTs enforce type compatibility  // for the left and right hand sides of the union.
Result of propagating changes to this union all node.
Result of propagating changes to this union all node .
node
DbUnionAllExpression
Union expression node in the update mapping view.
Union expression node in the update mapping view .