9
9
namespace NHibernate . Criterion . Lambda
10
10
{
11
11
12
- public class QueryOverProjectionBuilder < TReturn , TRoot , TSubType >
12
+ public class QueryOverProjectionBuilder < T >
13
13
{
14
14
15
- private TReturn fluentReturn ;
16
- private IQueryOver < TRoot , TSubType > criteria ;
17
15
private ProjectionList projectionList ;
18
16
private IProjection lastProjection = null ;
19
17
20
- public QueryOverProjectionBuilder ( TReturn fluentReturn , IQueryOver < TRoot , TSubType > criteria )
18
+ public QueryOverProjectionBuilder ( )
21
19
{
22
- this . fluentReturn = fluentReturn ;
23
- this . criteria = criteria ;
24
20
projectionList = Projections . ProjectionList ( ) ;
25
21
}
26
22
@@ -36,23 +32,19 @@ private void PushProjection(IProjection projection)
36
32
lastProjection = projection ;
37
33
}
38
34
39
- /// <summary>
40
- /// Create the ProjectionList and return to the query
41
- /// </summary>
42
- public TReturn EndSelect
35
+ internal ProjectionList ProjectionList
43
36
{
44
37
get
45
38
{
46
39
AddLastProjection ( ) ;
47
- criteria . Select ( projectionList ) ;
48
- return fluentReturn ;
40
+ return projectionList ;
49
41
}
50
42
}
51
43
52
44
/// <summary>
53
45
/// Create an alias for the previous projection
54
46
/// </summary>
55
- public QueryOverProjectionBuilder < TReturn , TRoot , TSubType > WithAlias ( Expression < Func < object > > alias )
47
+ public QueryOverProjectionBuilder < T > WithAlias ( Expression < Func < object > > alias )
56
48
{
57
49
string aliasContainer = ExpressionProcessor . FindMemberExpression ( alias . Body ) ;
58
50
lastProjection = Projections . Alias ( lastProjection , aliasContainer ) ;
@@ -62,7 +54,7 @@ public QueryOverProjectionBuilder<TReturn, TRoot, TSubType> WithAlias(Expression
62
54
/// <summary>
63
55
/// Select an arbitrary projection
64
56
/// </summary>
65
- public QueryOverProjectionBuilder < TReturn , TRoot , TSubType > Select ( IProjection projection )
57
+ public QueryOverProjectionBuilder < T > Select ( IProjection projection )
66
58
{
67
59
PushProjection ( projection ) ;
68
60
return this ;
@@ -71,7 +63,7 @@ public QueryOverProjectionBuilder<TReturn, TRoot, TSubType> Select(IProjection p
71
63
/// <summary>
72
64
/// A property average value
73
65
/// </summary>
74
- public QueryOverProjectionBuilder < TReturn , TRoot , TSubType > SelectAvg ( Expression < Func < TSubType , object > > expression )
66
+ public QueryOverProjectionBuilder < T > SelectAvg ( Expression < Func < T , object > > expression )
75
67
{
76
68
PushProjection ( Projections . Avg ( expression ) ) ;
77
69
return this ;
@@ -80,7 +72,7 @@ public QueryOverProjectionBuilder<TReturn, TRoot, TSubType> SelectAvg(Expression
80
72
/// <summary>
81
73
/// A property average value
82
74
/// </summary>
83
- public QueryOverProjectionBuilder < TReturn , TRoot , TSubType > SelectAvg ( Expression < Func < object > > expression )
75
+ public QueryOverProjectionBuilder < T > SelectAvg ( Expression < Func < object > > expression )
84
76
{
85
77
PushProjection ( Projections . Avg ( expression ) ) ;
86
78
return this ;
@@ -89,7 +81,7 @@ public QueryOverProjectionBuilder<TReturn, TRoot, TSubType> SelectAvg(Expression
89
81
/// <summary>
90
82
/// A property value count
91
83
/// </summary>
92
- public QueryOverProjectionBuilder < TReturn , TRoot , TSubType > SelectCount ( Expression < Func < TSubType , object > > expression )
84
+ public QueryOverProjectionBuilder < T > SelectCount ( Expression < Func < T , object > > expression )
93
85
{
94
86
PushProjection ( Projections . Count ( expression ) ) ;
95
87
return this ;
@@ -98,7 +90,7 @@ public QueryOverProjectionBuilder<TReturn, TRoot, TSubType> SelectCount(Expressi
98
90
/// <summary>
99
91
/// A property value count
100
92
/// </summary>
101
- public QueryOverProjectionBuilder < TReturn , TRoot , TSubType > SelectCount ( Expression < Func < object > > expression )
93
+ public QueryOverProjectionBuilder < T > SelectCount ( Expression < Func < object > > expression )
102
94
{
103
95
PushProjection ( Projections . Count ( expression ) ) ;
104
96
return this ;
@@ -107,7 +99,7 @@ public QueryOverProjectionBuilder<TReturn, TRoot, TSubType> SelectCount(Expressi
107
99
/// <summary>
108
100
/// A distinct property value count
109
101
/// </summary>
110
- public QueryOverProjectionBuilder < TReturn , TRoot , TSubType > SelectCountDistinct ( Expression < Func < TSubType , object > > expression )
102
+ public QueryOverProjectionBuilder < T > SelectCountDistinct ( Expression < Func < T , object > > expression )
111
103
{
112
104
PushProjection ( Projections . CountDistinct ( expression ) ) ;
113
105
return this ;
@@ -116,7 +108,7 @@ public QueryOverProjectionBuilder<TReturn, TRoot, TSubType> SelectCountDistinct(
116
108
/// <summary>
117
109
/// A distinct property value count
118
110
/// </summary>
119
- public QueryOverProjectionBuilder < TReturn , TRoot , TSubType > SelectCountDistinct ( Expression < Func < object > > expression )
111
+ public QueryOverProjectionBuilder < T > SelectCountDistinct ( Expression < Func < object > > expression )
120
112
{
121
113
PushProjection ( Projections . CountDistinct ( expression ) ) ;
122
114
return this ;
@@ -125,7 +117,7 @@ public QueryOverProjectionBuilder<TReturn, TRoot, TSubType> SelectCountDistinct(
125
117
/// <summary>
126
118
/// A grouping property value
127
119
/// </summary>
128
- public QueryOverProjectionBuilder < TReturn , TRoot , TSubType > SelectGroup ( Expression < Func < TSubType , object > > expression )
120
+ public QueryOverProjectionBuilder < T > SelectGroup ( Expression < Func < T , object > > expression )
129
121
{
130
122
PushProjection ( Projections . Group ( expression ) ) ;
131
123
return this ;
@@ -134,7 +126,7 @@ public QueryOverProjectionBuilder<TReturn, TRoot, TSubType> SelectGroup(Expressi
134
126
/// <summary>
135
127
/// A grouping property value
136
128
/// </summary>
137
- public QueryOverProjectionBuilder < TReturn , TRoot , TSubType > SelectGroup ( Expression < Func < object > > expression )
129
+ public QueryOverProjectionBuilder < T > SelectGroup ( Expression < Func < object > > expression )
138
130
{
139
131
PushProjection ( Projections . Group ( expression ) ) ;
140
132
return this ;
@@ -143,7 +135,7 @@ public QueryOverProjectionBuilder<TReturn, TRoot, TSubType> SelectGroup(Expressi
143
135
/// <summary>
144
136
/// A property maximum value
145
137
/// </summary>
146
- public QueryOverProjectionBuilder < TReturn , TRoot , TSubType > SelectMax ( Expression < Func < TSubType , object > > expression )
138
+ public QueryOverProjectionBuilder < T > SelectMax ( Expression < Func < T , object > > expression )
147
139
{
148
140
PushProjection ( Projections . Max ( expression ) ) ;
149
141
return this ;
@@ -152,7 +144,7 @@ public QueryOverProjectionBuilder<TReturn, TRoot, TSubType> SelectMax(Expression
152
144
/// <summary>
153
145
/// A property maximum value
154
146
/// </summary>
155
- public QueryOverProjectionBuilder < TReturn , TRoot , TSubType > SelectMax ( Expression < Func < object > > expression )
147
+ public QueryOverProjectionBuilder < T > SelectMax ( Expression < Func < object > > expression )
156
148
{
157
149
PushProjection ( Projections . Max ( expression ) ) ;
158
150
return this ;
@@ -161,7 +153,7 @@ public QueryOverProjectionBuilder<TReturn, TRoot, TSubType> SelectMax(Expression
161
153
/// <summary>
162
154
/// A property minimum value
163
155
/// </summary>
164
- public QueryOverProjectionBuilder < TReturn , TRoot , TSubType > SelectMin ( Expression < Func < TSubType , object > > expression )
156
+ public QueryOverProjectionBuilder < T > SelectMin ( Expression < Func < T , object > > expression )
165
157
{
166
158
PushProjection ( Projections . Min ( expression ) ) ;
167
159
return this ;
@@ -170,7 +162,7 @@ public QueryOverProjectionBuilder<TReturn, TRoot, TSubType> SelectMin(Expression
170
162
/// <summary>
171
163
/// A property minimum value
172
164
/// </summary>
173
- public QueryOverProjectionBuilder < TReturn , TRoot , TSubType > SelectMin ( Expression < Func < object > > expression )
165
+ public QueryOverProjectionBuilder < T > SelectMin ( Expression < Func < object > > expression )
174
166
{
175
167
PushProjection ( Projections . Min ( expression ) ) ;
176
168
return this ;
@@ -179,7 +171,7 @@ public QueryOverProjectionBuilder<TReturn, TRoot, TSubType> SelectMin(Expression
179
171
/// <summary>
180
172
/// A projected property value
181
173
/// </summary>
182
- public QueryOverProjectionBuilder < TReturn , TRoot , TSubType > Select ( Expression < Func < TSubType , object > > expression )
174
+ public QueryOverProjectionBuilder < T > Select ( Expression < Func < T , object > > expression )
183
175
{
184
176
PushProjection ( Projections . Property ( expression ) ) ;
185
177
return this ;
@@ -188,13 +180,13 @@ public QueryOverProjectionBuilder<TReturn, TRoot, TSubType> Select(Expression<Fu
188
180
/// <summary>
189
181
/// A projected property value
190
182
/// </summary>
191
- public QueryOverProjectionBuilder < TReturn , TRoot , TSubType > Select ( Expression < Func < object > > expression )
183
+ public QueryOverProjectionBuilder < T > Select ( Expression < Func < object > > expression )
192
184
{
193
185
PushProjection ( Projections . Property ( expression ) ) ;
194
186
return this ;
195
187
}
196
188
197
- public QueryOverProjectionBuilder < TReturn , TRoot , TSubType > SelectSubQuery < U > ( QueryOver < U > detachedQueryOver )
189
+ public QueryOverProjectionBuilder < T > SelectSubQuery < U > ( QueryOver < U > detachedQueryOver )
198
190
{
199
191
PushProjection ( Projections . SubQuery ( detachedQueryOver ) ) ;
200
192
return this ;
@@ -203,7 +195,7 @@ public QueryOverProjectionBuilder<TReturn, TRoot, TSubType> SelectSubQuery<U>(Qu
203
195
/// <summary>
204
196
/// A property value sum
205
197
/// </summary>
206
- public QueryOverProjectionBuilder < TReturn , TRoot , TSubType > SelectSum ( Expression < Func < TSubType , object > > expression )
198
+ public QueryOverProjectionBuilder < T > SelectSum ( Expression < Func < T , object > > expression )
207
199
{
208
200
PushProjection ( Projections . Sum ( expression ) ) ;
209
201
return this ;
@@ -212,7 +204,7 @@ public QueryOverProjectionBuilder<TReturn, TRoot, TSubType> SelectSum(Expression
212
204
/// <summary>
213
205
/// A property value sum
214
206
/// </summary>
215
- public QueryOverProjectionBuilder < TReturn , TRoot , TSubType > SelectSum ( Expression < Func < object > > expression )
207
+ public QueryOverProjectionBuilder < T > SelectSum ( Expression < Func < object > > expression )
216
208
{
217
209
PushProjection ( Projections . Sum ( expression ) ) ;
218
210
return this ;
0 commit comments