4
4
// Created by: Alexis Kochetov
5
5
// Created: 2009.05.29
6
6
7
- using System ;
8
- using System . Collections . Generic ;
9
- using System . Linq ;
10
- using Xtensive . Core ;
11
7
using Xtensive . Tuples . Transform ;
12
8
using Xtensive . Orm . Internals ;
13
9
using Xtensive . Orm . Model ;
@@ -31,27 +27,22 @@ private struct EntityMappingCache
31
27
/// <summary>
32
28
/// Gets model of current <see cref="DomainModel">domain model.</see>
33
29
/// </summary>
34
- public DomainModel Model { get ; private set ; }
30
+ public DomainModel Model => Session . Domain . Model ;
35
31
36
32
/// <summary>
37
33
/// Gets the session in which materialization is executing.
38
34
/// </summary>
39
- public Session Session { get ; private set ; }
35
+ public Session Session { get ; }
40
36
41
37
/// <summary>
42
38
/// Gets count of entities in query row.
43
39
/// </summary>
44
- public int EntitiesInRow { get ; private set ; }
40
+ public int EntitiesInRow => entityMappings . Length ;
45
41
46
42
/// <summary>
47
43
/// Gets <see cref="StorageNode">node</see> specific type identifiers registry of current node.
48
44
/// </summary>
49
- public TypeIdRegistry TypeIdRegistry
50
- {
51
- get {
52
- return Session . StorageNode . TypeIdRegistry ;
53
- }
54
- }
45
+ public TypeIdRegistry TypeIdRegistry => Session . StorageNode . TypeIdRegistry ;
55
46
56
47
/// <summary>
57
48
/// Gets or sets queue of materialization actions.
@@ -109,15 +100,10 @@ private int ResolveTypeToNodeSpecificTypeIdentifier(TypeInfo typeInfo)
109
100
public MaterializationContext ( Session session , int entityCount )
110
101
{
111
102
Session = session ;
112
- Model = session . Domain . Model ;
113
- EntitiesInRow = entityCount ;
114
103
115
104
entityMappings = new EntityMappingCache [ entityCount ] ;
116
-
117
105
for ( int i = 0 ; i < entityMappings . Length ; i ++ )
118
- entityMappings [ i ] = new EntityMappingCache {
119
- Items = new Dictionary < int , TypeMapping > ( )
120
- } ;
106
+ entityMappings [ i ] = new ( ) { Items = new Dictionary < int , TypeMapping > ( ) } ;
121
107
}
122
108
}
123
- }
109
+ }
0 commit comments