@@ -25,14 +25,14 @@ namespace Xtensive.Orm.Linq
25
25
{
26
26
internal sealed class TranslatorContext
27
27
{
28
- private readonly AliasGenerator resultAliasGenerator ;
29
- private readonly AliasGenerator columnAliasGenerator ;
28
+ private AliasGenerator resultAliasGenerator = AliasGenerator . Create ( "#{0}{1}" ) ;
29
+ private AliasGenerator columnAliasGenerator = AliasGenerator . Create ( new [ ] { "c01umn" } ) ;
30
30
private readonly Dictionary < ParameterExpression , Parameter < Tuple > > tupleParameters ;
31
31
private readonly Dictionary < CompilableProvider , ApplyParameter > applyParameters ;
32
32
private readonly Dictionary < ParameterExpression , ItemProjectorExpression > boundItemProjectors ;
33
33
private readonly Dictionary < MemberInfo , int > queryReuses ;
34
34
35
- public CompilerConfiguration RseCompilerConfiguration { get ; }
35
+ public readonly CompilerConfiguration RseCompilerConfiguration ;
36
36
37
37
public ProviderInfo ProviderInfo { get ; }
38
38
@@ -124,11 +124,7 @@ public ItemProjectorExpression GetBoundItemProjector(ParameterExpression paramet
124
124
return result ;
125
125
}
126
126
127
- public void RegisterPossibleQueryReuse ( MemberInfo memberInfo )
128
- {
129
- if ( ! queryReuses . ContainsKey ( memberInfo ) )
130
- queryReuses . Add ( memberInfo , 0 ) ;
131
- }
127
+ public void RegisterPossibleQueryReuse ( MemberInfo memberInfo ) => queryReuses . TryAdd ( memberInfo , 0 ) ;
132
128
133
129
public bool CheckIfQueryReusePossible ( MemberInfo memberInfo )
134
130
{
@@ -148,11 +144,10 @@ private Expression ApplyPreprocessor(IQueryPreprocessor preprocessor, Session se
148
144
149
145
// Constructors
150
146
151
- public TranslatorContext ( Session session , CompilerConfiguration rseCompilerConfiguration , Expression query ,
147
+ public TranslatorContext ( Session session , in CompilerConfiguration rseCompilerConfiguration , Expression query ,
152
148
CompiledQueryProcessingScope compiledQueryScope )
153
149
{
154
150
ArgumentNullException . ThrowIfNull ( session ) ;
155
- ArgumentNullException . ThrowIfNull ( rseCompilerConfiguration ) ;
156
151
ArgumentNullException . ThrowIfNull ( query ) ;
157
152
158
153
Domain = session . Domain ;
@@ -173,8 +168,6 @@ public TranslatorContext(Session session, CompilerConfiguration rseCompilerConfi
173
168
query = PersistentIndexerRewriter . Rewrite ( query , this ) ;
174
169
Query = query ;
175
170
176
- resultAliasGenerator = AliasGenerator . Create ( "#{0}{1}" ) ;
177
- columnAliasGenerator = AliasGenerator . Create ( new [ ] { "c01umn" } ) ;
178
171
CustomCompilerProvider = Domain . Handler . GetMemberCompilerProvider < Expression > ( ) ;
179
172
Model = Domain . Model ;
180
173
TypeIdRegistry = session . StorageNode . TypeIdRegistry ;
0 commit comments