1 //---------------------------------------------------------------------
2 // <copyright file="MethodExpr.cs" company="Microsoft">
3 // Copyright (c) Microsoft Corporation. All rights reserved.
7 // @backupOwner Microsoft
8 //---------------------------------------------------------------------
10 namespace System
.Data
.Common
.EntitySql
.AST
13 using System
.Globalization
;
14 using System
.Collections
;
15 using System
.Collections
.Generic
;
16 using System
.Data
.Common
.CommandTrees
;
17 using System
.Diagnostics
;
20 /// Represents invocation expression: expr(...)
22 internal sealed class MethodExpr
: GroupAggregateExpr
24 private readonly Node _expr
;
25 private readonly NodeList
<Node
> _args
;
26 private readonly NodeList
<RelshipNavigationExpr
> _relationships
;
29 /// Initializes method ast node.
31 internal MethodExpr(Node expr
,
32 DistinctKind distinctKind
,
33 NodeList
<Node
> args
) : this (expr
, distinctKind
, args
, null)
37 /// Intializes a method ast node with relationships.
39 internal MethodExpr(Node expr
,
40 DistinctKind distinctKind
,
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");
49 _relationships
= relationships
;
53 /// For the following expression: "a.b.c.Foo()", returns "a.b.c.Foo".
63 internal NodeList
<Node
> Args
69 /// True if there are associated relationship expressions.
71 internal bool HasRelationships
73 get { return null != _relationships && _relationships.Count > 0; }
77 /// Optional relationship list.
79 internal NodeList
<RelshipNavigationExpr
> Relationships
81 get { return _relationships; }