@@ -40,8 +40,8 @@ public virtual Expression ApplySelect(FieldSelection selection, QueryClauseBuild
40
40
private Expression CreateLambdaBodyInitializer ( FieldSelection selection , ResourceType resourceType , LambdaScope lambdaScope ,
41
41
bool lambdaAccessorRequiresTestForNull , QueryClauseBuilderContext context )
42
42
{
43
- IEntityType entityType = context . EntityModel . FindEntityType ( resourceType . ClrType ) ! ;
44
- IEntityType [ ] concreteEntityTypes = entityType . GetConcreteDerivedTypesInclusive ( ) . ToArray ( ) ;
43
+ IReadOnlyEntityType entityType = context . EntityModel . FindEntityType ( resourceType . ClrType ) ! ;
44
+ IReadOnlyEntityType [ ] concreteEntityTypes = entityType . GetConcreteDerivedTypesInclusive ( ) . ToArray ( ) ;
45
45
46
46
Expression bodyInitializer = concreteEntityTypes . Length > 1
47
47
? CreateLambdaBodyInitializerForTypeHierarchy ( selection , resourceType , concreteEntityTypes , lambdaScope , context )
@@ -56,12 +56,12 @@ private Expression CreateLambdaBodyInitializer(FieldSelection selection, Resourc
56
56
}
57
57
58
58
private Expression CreateLambdaBodyInitializerForTypeHierarchy ( FieldSelection selection , ResourceType baseResourceType ,
59
- IEnumerable < IEntityType > concreteEntityTypes , LambdaScope lambdaScope , QueryClauseBuilderContext context )
59
+ IEnumerable < IReadOnlyEntityType > concreteEntityTypes , LambdaScope lambdaScope , QueryClauseBuilderContext context )
60
60
{
61
61
IReadOnlySet < ResourceType > resourceTypes = selection . GetResourceTypes ( ) ;
62
62
Expression rootCondition = lambdaScope . Accessor ;
63
63
64
- foreach ( IEntityType entityType in concreteEntityTypes )
64
+ foreach ( IReadOnlyEntityType entityType in concreteEntityTypes )
65
65
{
66
66
ResourceType ? resourceType = resourceTypes . SingleOrDefault ( type => type . ClrType == entityType . ClrType ) ;
67
67
@@ -115,7 +115,7 @@ private Expression CreateLambdaBodyInitializerForSingleType(FieldSelection selec
115
115
}
116
116
117
117
private static ICollection < PropertySelector > ToPropertySelectors ( FieldSelectors fieldSelectors , ResourceType resourceType , Type elementType ,
118
- IModel entityModel )
118
+ IReadOnlyModel entityModel )
119
119
{
120
120
var propertySelectors = new Dictionary < PropertyInfo , PropertySelector > ( ) ;
121
121
@@ -134,17 +134,18 @@ private static ICollection<PropertySelector> ToPropertySelectors(FieldSelectors
134
134
return propertySelectors . Values ;
135
135
}
136
136
137
- private static void IncludeAllScalarProperties ( Type elementType , Dictionary < PropertyInfo , PropertySelector > propertySelectors , IModel entityModel )
137
+ private static void IncludeAllScalarProperties ( Type elementType , Dictionary < PropertyInfo , PropertySelector > propertySelectors , IReadOnlyModel entityModel )
138
138
{
139
- IEntityType entityType = entityModel . GetEntityTypes ( ) . Single ( type => type . ClrType == elementType ) ;
139
+ IReadOnlyEntityType entityType = entityModel . GetEntityTypes ( ) . Single ( type => type . ClrType == elementType ) ;
140
140
141
- foreach ( IProperty property in entityType . GetProperties ( ) . Where ( property => ! property . IsShadowProperty ( ) ) )
141
+ foreach ( IReadOnlyProperty property in entityType . GetProperties ( ) . Where ( property => ! property . IsShadowProperty ( ) ) )
142
142
{
143
143
var propertySelector = new PropertySelector ( property . PropertyInfo ! ) ;
144
144
IncludeWritableProperty ( propertySelector , propertySelectors ) ;
145
145
}
146
146
147
- foreach ( INavigation navigation in entityType . GetNavigations ( ) . Where ( navigation => navigation . ForeignKey . IsOwnership && ! navigation . IsShadowProperty ( ) ) )
147
+ foreach ( IReadOnlyNavigation navigation in entityType . GetNavigations ( )
148
+ . Where ( navigation => navigation . ForeignKey . IsOwnership && ! navigation . IsShadowProperty ( ) ) )
148
149
{
149
150
var propertySelector = new PropertySelector ( navigation . PropertyInfo ! ) ;
150
151
IncludeWritableProperty ( propertySelector , propertySelectors ) ;
0 commit comments