@@ -252,21 +252,21 @@ private QueryExpression ParseComparisonRightTerm(QueryExpression leftTerm)
252
252
253
253
var leftAttribute = ( AttrAttribute ) leftLastField ;
254
254
255
- Func < string , int , object > constantValueConverter = GetConstantValueConverterForAttribute ( leftAttribute ) ;
255
+ ConstantValueConverter constantValueConverter = GetConstantValueConverterForAttribute ( leftAttribute ) ;
256
256
return ParseTypedComparisonRightTerm ( leftAttribute . Property . PropertyType , constantValueConverter ) ;
257
257
}
258
258
259
259
if ( leftTerm is FunctionExpression leftFunction )
260
260
{
261
- Func < string , int , object > constantValueConverter = GetConstantValueConverterForType ( leftFunction . ReturnType ) ;
261
+ ConstantValueConverter constantValueConverter = GetConstantValueConverterForType ( leftFunction . ReturnType ) ;
262
262
return ParseTypedComparisonRightTerm ( leftFunction . ReturnType , constantValueConverter ) ;
263
263
}
264
264
265
265
throw new InvalidOperationException (
266
266
$ "Internal error: Expected left term to be a function or field chain, instead of '{ leftTerm . GetType ( ) . Name } ': '{ leftTerm } '.") ;
267
267
}
268
268
269
- private QueryExpression ParseTypedComparisonRightTerm ( Type leftType , Func < string , int , object > constantValueConverter )
269
+ private QueryExpression ParseTypedComparisonRightTerm ( Type leftType , ConstantValueConverter constantValueConverter )
270
270
{
271
271
bool allowNull = RuntimeTypeConverter . CanContainNull ( leftType ) ;
272
272
@@ -329,7 +329,7 @@ protected virtual MatchTextExpression ParseTextMatch(string operatorName)
329
329
330
330
EatSingleCharacterToken ( TokenKind . Comma ) ;
331
331
332
- Func < string , int , object > constantValueConverter = GetConstantValueConverterForAttribute ( targetAttribute ) ;
332
+ ConstantValueConverter constantValueConverter = GetConstantValueConverterForAttribute ( targetAttribute ) ;
333
333
LiteralConstantExpression constant = ParseConstant ( constantValueConverter ) ;
334
334
335
335
EatSingleCharacterToken ( TokenKind . CloseParen ) ;
@@ -352,7 +352,7 @@ protected virtual AnyExpression ParseAny()
352
352
353
353
ImmutableHashSet < LiteralConstantExpression > . Builder constantsBuilder = ImmutableHashSet . CreateBuilder < LiteralConstantExpression > ( ) ;
354
354
355
- Func < string , int , object > constantValueConverter = GetConstantValueConverterForAttribute ( targetAttribute ) ;
355
+ ConstantValueConverter constantValueConverter = GetConstantValueConverterForAttribute ( targetAttribute ) ;
356
356
LiteralConstantExpression constant = ParseConstant ( constantValueConverter ) ;
357
357
constantsBuilder . Add ( constant ) ;
358
358
@@ -489,7 +489,7 @@ private static ResourceType ResolveDerivedType(ResourceType baseType, string der
489
489
return filter ;
490
490
}
491
491
492
- private LiteralConstantExpression ParseConstant ( Func < string , int , object > constantValueConverter )
492
+ private LiteralConstantExpression ParseConstant ( ConstantValueConverter constantValueConverter )
493
493
{
494
494
int position = GetNextTokenPositionOrEnd ( ) ;
495
495
@@ -514,7 +514,7 @@ private NullConstantExpression ParseNull()
514
514
throw new QueryParseException ( "null expected." , position ) ;
515
515
}
516
516
517
- private static Func < string , int , object > GetConstantValueConverterForType ( Type destinationType )
517
+ protected virtual ConstantValueConverter GetConstantValueConverterForType ( Type destinationType )
518
518
{
519
519
return ( stringValue , position ) =>
520
520
{
@@ -529,7 +529,7 @@ private static Func<string, int, object> GetConstantValueConverterForType(Type d
529
529
} ;
530
530
}
531
531
532
- private Func < string , int , object > GetConstantValueConverterForAttribute ( AttrAttribute attribute )
532
+ private ConstantValueConverter GetConstantValueConverterForAttribute ( AttrAttribute attribute )
533
533
{
534
534
if ( attribute is { Property . Name : nameof ( Identifiable < object > . Id ) } )
535
535
{
0 commit comments