internal override SqlNode VisitUnion(SqlUnion su) { if (su.All) { this.IsValid = false; } this.IsDistinct = true; this.AddIdentityMembers(su.GetClrType().GetProperties()); return(su); }
private static Type GetClrType(SqlNode node) { SqlTableValuedFunctionCall call = node as SqlTableValuedFunctionCall; if (call != null) { return(call.RowType.Type); } SqlExpression expression = node as SqlExpression; if (expression != null) { if (TypeSystem.IsSequenceType(expression.ClrType)) { return(TypeSystem.GetElementType(expression.ClrType)); } return(expression.ClrType); } SqlSelect select = node as SqlSelect; if (select != null) { return(select.Selection.ClrType); } SqlTable table = node as SqlTable; if (table != null) { return(table.RowType.Type); } SqlUnion union = node as SqlUnion; if (union == null) { throw Error.UnexpectedNode(node.NodeType); } return(union.GetClrType()); }