Updates referencesource to .NET 4.7
[mono-project.git] / mcs / class / referencesource / System.Data.Entity / System / Data / Common / EntitySql / AST / MethodExpr.cs
blobb95887f0a82c7add71f2adb46203f1d6ce17ff33
1 //---------------------------------------------------------------------
2 // <copyright file="MethodExpr.cs" company="Microsoft">
3 // Copyright (c) Microsoft Corporation. All rights reserved.
4 // </copyright>
5 //
6 // @owner Microsoft
7 // @backupOwner Microsoft
8 //---------------------------------------------------------------------
10 namespace System.Data.Common.EntitySql.AST
12 using System;
13 using System.Globalization;
14 using System.Collections;
15 using System.Collections.Generic;
16 using System.Data.Common.CommandTrees;
17 using System.Diagnostics;
19 /// <summary>
20 /// Represents invocation expression: expr(...)
21 /// </summary>
22 internal sealed class MethodExpr : GroupAggregateExpr
24 private readonly Node _expr;
25 private readonly NodeList<Node> _args;
26 private readonly NodeList<RelshipNavigationExpr> _relationships;
28 /// <summary>
29 /// Initializes method ast node.
30 /// </summary>
31 internal MethodExpr(Node expr,
32 DistinctKind distinctKind,
33 NodeList<Node> args) : this (expr, distinctKind, args, null)
34 { }
36 /// <summary>
37 /// Intializes a method ast node with relationships.
38 /// </summary>
39 internal MethodExpr(Node expr,
40 DistinctKind distinctKind,
41 NodeList<Node> args,
42 NodeList<RelshipNavigationExpr> relationships) : base(distinctKind)
44 Debug.Assert(expr != null, "expr != null");
45 Debug.Assert(args == null || args.Count > 0, "args must be null or a non-empty list");
47 _expr = expr;
48 _args = args;
49 _relationships = relationships;
52 /// <summary>
53 /// For the following expression: "a.b.c.Foo()", returns "a.b.c.Foo".
54 /// </summary>
55 internal Node Expr
57 get { return _expr; }
60 /// <summary>
61 /// Argument list.
62 /// </summary>
63 internal NodeList<Node> Args
65 get { return _args; }
68 /// <summary>
69 /// True if there are associated relationship expressions.
70 /// </summary>
71 internal bool HasRelationships
73 get { return null != _relationships && _relationships.Count > 0; }
76 /// <summary>
77 /// Optional relationship list.
78 /// </summary>
79 internal NodeList<RelshipNavigationExpr> Relationships
81 get { return _relationships; }