@@ -122,15 +122,15 @@ internal static string TryGetEntityName(
122
122
// q.OneToMany[0].CompositeElement.Prop
123
123
if ( entityName == null )
124
124
{
125
- var index = GetComponentPropertyIndex ( componentType , member . Path ) ;
126
- if ( ! index . HasValue )
125
+ var index = Array . IndexOf ( componentType . PropertyNames , member . Path ) ;
126
+ if ( index < 0 )
127
127
{
128
128
memberPath = null ;
129
129
memberType = null ;
130
130
return null ;
131
131
}
132
132
133
- type = componentType . Subtypes [ index . Value ] ;
133
+ type = componentType . Subtypes [ index ] ;
134
134
continue ;
135
135
}
136
136
@@ -283,20 +283,6 @@ private static string GetEntityName(
283
283
return entityName ;
284
284
}
285
285
286
- private static int ? GetComponentPropertyIndex ( IAbstractComponentType componentType , string name )
287
- {
288
- var names = componentType . PropertyNames ;
289
- for ( var i = 0 ; i < names . Length ; i ++ )
290
- {
291
- if ( names [ i ] . Equals ( name ) )
292
- {
293
- return i ;
294
- }
295
- }
296
-
297
- return null ;
298
- }
299
-
300
286
private static IType GetType (
301
287
string entityName ,
302
288
IType currentType ,
@@ -314,10 +300,11 @@ private static IType GetType(
314
300
// q.OneToMany[0].CompositeElement.Prop
315
301
if ( currentType is IAbstractComponentType componentType )
316
302
{
317
- var index = GetComponentPropertyIndex ( componentType , memberPath ) ;
318
- return index . HasValue
319
- ? componentType . Subtypes [ index . Value ]
320
- : null ;
303
+ var names = componentType . PropertyNames ;
304
+ var index = Array . IndexOf ( names , memberPath ) ;
305
+ return index < 0
306
+ ? null
307
+ : componentType . Subtypes [ index ] ;
321
308
}
322
309
323
310
return null ;
@@ -336,8 +323,7 @@ private static IType GetType(
336
323
// q.OneToMany[0]
337
324
if ( currentType is IAssociationType associationType )
338
325
{
339
- var queryableCollection =
340
- ( IQueryableCollection ) associationType . GetAssociatedJoinable ( sessionFactory ) ;
326
+ var queryableCollection = ( IQueryableCollection ) associationType . GetAssociatedJoinable ( sessionFactory ) ;
341
327
return queryableCollection . ElementType ;
342
328
}
343
329
0 commit comments