forked from nhibernate/nhibernate-core
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathNhOuterJoinClause.cs
46 lines (39 loc) · 1.16 KB
/
NhOuterJoinClause.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
using System;
using System.Linq.Expressions;
using Remotion.Linq;
using Remotion.Linq.Clauses;
namespace NHibernate.Linq.Clauses
{
/// <summary>
/// A wrapper for <see cref="JoinClause"/> that is used to mark it as an outer join.
/// </summary>
public class NhOuterJoinClause : NhClauseBase, IBodyClause, IClause, IQuerySource
{
public NhOuterJoinClause(JoinClause joinClause)
{
JoinClause = joinClause;
}
public JoinClause JoinClause { get; }
public string ItemName => JoinClause.ItemName;
public System.Type ItemType => JoinClause.ItemType;
public void TransformExpressions(Func<Expression, Expression> transformation)
{
JoinClause.TransformExpressions(transformation);
}
public IBodyClause Clone(CloneContext cloneContext)
{
return new NhOuterJoinClause(JoinClause.Clone(cloneContext));
}
protected override void Accept(INhQueryModelVisitor visitor, QueryModel queryModel, int index)
{
if (visitor is INhQueryModelVisitorExtended queryModelVisitorExtended)
{
queryModelVisitorExtended.VisitNhOuterJoinClause(this, queryModel, index);
}
else
{
visitor.VisitJoinClause(JoinClause, queryModel, index);
}
}
}
}