@@ -40,8 +40,8 @@ public virtual Expression ApplySelect(FieldSelection selection, QueryClauseBuild
4040 private Expression CreateLambdaBodyInitializer ( FieldSelection selection , ResourceType resourceType , LambdaScope lambdaScope ,
4141 bool lambdaAccessorRequiresTestForNull , QueryClauseBuilderContext context )
4242 {
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 ( ) ;
4545
4646 Expression bodyInitializer = concreteEntityTypes . Length > 1
4747 ? CreateLambdaBodyInitializerForTypeHierarchy ( selection , resourceType , concreteEntityTypes , lambdaScope , context )
@@ -56,12 +56,12 @@ private Expression CreateLambdaBodyInitializer(FieldSelection selection, Resourc
5656 }
5757
5858 private Expression CreateLambdaBodyInitializerForTypeHierarchy ( FieldSelection selection , ResourceType baseResourceType ,
59- IEnumerable < IEntityType > concreteEntityTypes , LambdaScope lambdaScope , QueryClauseBuilderContext context )
59+ IEnumerable < IReadOnlyEntityType > concreteEntityTypes , LambdaScope lambdaScope , QueryClauseBuilderContext context )
6060 {
6161 IReadOnlySet < ResourceType > resourceTypes = selection . GetResourceTypes ( ) ;
6262 Expression rootCondition = lambdaScope . Accessor ;
6363
64- foreach ( IEntityType entityType in concreteEntityTypes )
64+ foreach ( IReadOnlyEntityType entityType in concreteEntityTypes )
6565 {
6666 ResourceType ? resourceType = resourceTypes . SingleOrDefault ( type => type . ClrType == entityType . ClrType ) ;
6767
@@ -115,7 +115,7 @@ private Expression CreateLambdaBodyInitializerForSingleType(FieldSelection selec
115115 }
116116
117117 private static ICollection < PropertySelector > ToPropertySelectors ( FieldSelectors fieldSelectors , ResourceType resourceType , Type elementType ,
118- IModel entityModel )
118+ IReadOnlyModel entityModel )
119119 {
120120 var propertySelectors = new Dictionary < PropertyInfo , PropertySelector > ( ) ;
121121
@@ -134,17 +134,18 @@ private static ICollection<PropertySelector> ToPropertySelectors(FieldSelectors
134134 return propertySelectors . Values ;
135135 }
136136
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 )
138138 {
139- IEntityType entityType = entityModel . GetEntityTypes ( ) . Single ( type => type . ClrType == elementType ) ;
139+ IReadOnlyEntityType entityType = entityModel . GetEntityTypes ( ) . Single ( type => type . ClrType == elementType ) ;
140140
141- foreach ( IProperty property in entityType . GetProperties ( ) . Where ( property => ! property . IsShadowProperty ( ) ) )
141+ foreach ( IReadOnlyProperty property in entityType . GetProperties ( ) . Where ( property => ! property . IsShadowProperty ( ) ) )
142142 {
143143 var propertySelector = new PropertySelector ( property . PropertyInfo ! ) ;
144144 IncludeWritableProperty ( propertySelector , propertySelectors ) ;
145145 }
146146
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 ( ) ) )
148149 {
149150 var propertySelector = new PropertySelector ( navigation . PropertyInfo ! ) ;
150151 IncludeWritableProperty ( propertySelector , propertySelectors ) ;
0 commit comments