@@ -58,7 +58,6 @@ public abstract class ComparisonOperator : SmartEnum<ComparisonOperator>
5858 public static ComparisonOperator HasCountLessThanOrEqualOperator ( bool caseInsensitive = false , bool usesAll = false ) => new HasCountLessThanOrEqualType ( caseInsensitive ) ;
5959 public static ComparisonOperator HasOperator ( bool caseInsensitive = false , bool usesAll = false ) => new HasType ( caseInsensitive ) ;
6060 public static ComparisonOperator DoesNotHaveOperator ( bool caseInsensitive = false , bool usesAll = false ) => new DoesNotHaveType ( caseInsensitive ) ;
61-
6261
6362 public static ComparisonOperator GetByOperatorString ( string op , bool caseInsensitive = false , bool usesAll = false )
6463 {
@@ -175,6 +174,7 @@ public static ComparisonOperator GetByOperatorString(string op, bool caseInsensi
175174 public const char CaseSensitiveAppendix = '*' ;
176175 public const char AllPrefix = '%' ;
177176 public abstract string Operator ( ) ;
177+ public abstract bool IsCountOperator ( ) ;
178178 public bool CaseInsensitive { get ; protected set ; }
179179 public bool UsesAll { get ; protected set ; }
180180 public abstract Expression GetExpression < T > ( Expression left , Expression right , Type ? dbContextType ) ;
@@ -191,6 +191,7 @@ public EqualsType(bool caseInsensitive = false, bool usesAll = false) : base("==
191191 }
192192
193193 public override string Operator ( ) => CaseInsensitive ? $ "{ Name } { CaseSensitiveAppendix } " : Name ;
194+ public override bool IsCountOperator ( ) => false ;
194195 public override Expression GetExpression < T > ( Expression left , Expression right , Type ? dbContextType )
195196 {
196197 if ( left . Type . IsGenericType && left . Type . GetGenericTypeDefinition ( ) == typeof ( IEnumerable < > ) )
@@ -223,6 +224,7 @@ public NotEqualsType(bool caseInsensitive = false, bool usesAll = false) : base(
223224 }
224225
225226 public override string Operator ( ) => CaseInsensitive ? $ "{ Name } { CaseSensitiveAppendix } " : Name ;
227+ public override bool IsCountOperator ( ) => false ;
226228 public override Expression GetExpression < T > ( Expression left , Expression right , Type ? dbContextType )
227229 {
228230 if ( left . Type . IsGenericType && left . Type . GetGenericTypeDefinition ( ) == typeof ( IEnumerable < > ) )
@@ -255,6 +257,7 @@ public GreaterThanType(bool caseInsensitive = false, bool usesAll = false) : bas
255257 }
256258
257259 public override string Operator ( ) => Name ;
260+ public override bool IsCountOperator ( ) => false ;
258261 public override Expression GetExpression < T > ( Expression left , Expression right , Type ? dbContextType )
259262 {
260263 if ( left . Type . IsGenericType && left . Type . GetGenericTypeDefinition ( ) == typeof ( IEnumerable < > ) )
@@ -272,6 +275,7 @@ public LessThanType(bool caseInsensitive = false, bool usesAll = false) : base("
272275 }
273276
274277 public override string Operator ( ) => Name ;
278+ public override bool IsCountOperator ( ) => false ;
275279 public override Expression GetExpression < T > ( Expression left , Expression right , Type ? dbContextType )
276280 {
277281 if ( left . Type . IsGenericType && left . Type . GetGenericTypeDefinition ( ) == typeof ( IEnumerable < > ) )
@@ -285,6 +289,7 @@ public override Expression GetExpression<T>(Expression left, Expression right, T
285289 private class GreaterThanOrEqualType : ComparisonOperator
286290 {
287291 public override string Operator ( ) => Name ;
292+ public override bool IsCountOperator ( ) => false ;
288293 public GreaterThanOrEqualType ( bool caseInsensitive = false , bool usesAll = false ) : base ( ">=" , 4 , caseInsensitive , usesAll )
289294 {
290295 }
@@ -304,6 +309,7 @@ public LessThanOrEqualType(bool caseInsensitive = false, bool usesAll = false) :
304309 {
305310 }
306311 public override string Operator ( ) => Name ;
312+ public override bool IsCountOperator ( ) => false ;
307313 public override Expression GetExpression < T > ( Expression left , Expression right , Type ? dbContextType )
308314 {
309315 if ( left . Type . IsGenericType && left . Type . GetGenericTypeDefinition ( ) == typeof ( IEnumerable < > ) )
@@ -321,6 +327,7 @@ public ContainsType(bool caseInsensitive = false, bool usesAll = false) : base("
321327 }
322328
323329 public override string Operator ( ) => CaseInsensitive ? $ "{ Name } { CaseSensitiveAppendix } " : Name ;
330+ public override bool IsCountOperator ( ) => false ;
324331 public override Expression GetExpression < T > ( Expression left , Expression right , Type ? dbContextType )
325332 {
326333 if ( left . Type . IsGenericType && left . Type . GetGenericTypeDefinition ( ) == typeof ( IEnumerable < > ) )
@@ -348,6 +355,7 @@ public StartsWithType(bool caseInsensitive = false, bool usesAll = false) : base
348355 }
349356
350357 public override string Operator ( ) => CaseInsensitive ? $ "{ Name } { CaseSensitiveAppendix } " : Name ;
358+ public override bool IsCountOperator ( ) => false ;
351359 public override Expression GetExpression < T > ( Expression left , Expression right , Type ? dbContextType )
352360 {
353361 if ( left . Type . IsGenericType && left . Type . GetGenericTypeDefinition ( ) == typeof ( IEnumerable < > ) )
@@ -375,6 +383,7 @@ public EndsWithType(bool caseInsensitive = false, bool usesAll = false) : base("
375383 }
376384
377385 public override string Operator ( ) => CaseInsensitive ? $ "{ Name } { CaseSensitiveAppendix } " : Name ;
386+ public override bool IsCountOperator ( ) => false ;
378387 public override Expression GetExpression < T > ( Expression left , Expression right , Type ? dbContextType )
379388 {
380389 if ( left . Type . IsGenericType && left . Type . GetGenericTypeDefinition ( ) == typeof ( IEnumerable < > ) )
@@ -402,6 +411,7 @@ public NotContainsType(bool caseInsensitive = false, bool usesAll = false) : bas
402411 }
403412
404413 public override string Operator ( ) => CaseInsensitive ? $ "{ Name } { CaseSensitiveAppendix } " : Name ;
414+ public override bool IsCountOperator ( ) => false ;
405415 public override Expression GetExpression < T > ( Expression left , Expression right , Type ? dbContextType )
406416 {
407417 if ( left . Type . IsGenericType && left . Type . GetGenericTypeDefinition ( ) == typeof ( IEnumerable < > ) )
@@ -430,6 +440,7 @@ public NotStartsWithType(bool caseInsensitive = false, bool usesAll = false) : b
430440 }
431441
432442 public override string Operator ( ) => CaseInsensitive ? $ "{ Name } { CaseSensitiveAppendix } " : Name ;
443+ public override bool IsCountOperator ( ) => false ;
433444 public override Expression GetExpression < T > ( Expression left , Expression right , Type ? dbContextType )
434445 {
435446 if ( left . Type . IsGenericType && left . Type . GetGenericTypeDefinition ( ) == typeof ( IEnumerable < > ) )
@@ -457,6 +468,7 @@ public NotEndsWithType(bool caseInsensitive = false, bool usesAll = false) : bas
457468 }
458469
459470 public override string Operator ( ) => CaseInsensitive ? $ "{ Name } { CaseSensitiveAppendix } " : Name ;
471+ public override bool IsCountOperator ( ) => false ;
460472 public override Expression GetExpression < T > ( Expression left , Expression right , Type ? dbContextType )
461473 {
462474 if ( left . Type . IsGenericType && left . Type . GetGenericTypeDefinition ( ) == typeof ( IEnumerable < > ) )
@@ -484,6 +496,7 @@ public InType(bool caseInsensitive = false, bool usesAll = false) : base("^^", 1
484496 }
485497
486498 public override string Operator ( ) => CaseInsensitive ? $ "{ Name } { CaseSensitiveAppendix } " : Name ;
499+ public override bool IsCountOperator ( ) => false ;
487500 public override Expression GetExpression < T > ( Expression left , Expression right , Type ? dbContextType )
488501 {
489502 var leftType = left . Type == typeof ( Guid ) || left . Type == typeof ( Guid ? )
@@ -533,6 +546,7 @@ public SoundsLikeType(bool caseInsensitive = false, bool usesAll = false) : base
533546 }
534547
535548 public override string Operator ( ) => Name ;
549+ public override bool IsCountOperator ( ) => false ;
536550
537551 public override Expression GetExpression < T > ( Expression left , Expression right , Type ? dbContextType )
538552 {
@@ -561,6 +575,7 @@ public DoesNotSoundLikeType(bool caseInsensitive = false, bool usesAll = false)
561575 }
562576
563577 public override string Operator ( ) => Name ;
578+ public override bool IsCountOperator ( ) => false ;
564579
565580 public override Expression GetExpression < T > ( Expression left , Expression right , Type ? dbContextType )
566581 {
@@ -589,6 +604,7 @@ public HasCountEqualToType(bool caseInsensitive = false, bool usesAll = false) :
589604 }
590605
591606 public override string Operator ( ) => CaseInsensitive ? $ "{ Name } { CaseSensitiveAppendix } " : Name ;
607+ public override bool IsCountOperator ( ) => true ;
592608 public override Expression GetExpression < T > ( Expression left , Expression right , Type ? dbContextType )
593609 {
594610 return GetCountExpression ( left , right , nameof ( Expression . Equal ) ) ;
@@ -602,6 +618,7 @@ public HasCountNotEqualToType(bool caseInsensitive = false, bool usesAll = false
602618 }
603619
604620 public override string Operator ( ) => CaseInsensitive ? $ "{ Name } { CaseSensitiveAppendix } " : Name ;
621+ public override bool IsCountOperator ( ) => true ;
605622 public override Expression GetExpression < T > ( Expression left , Expression right , Type ? dbContextType )
606623 {
607624 return GetCountExpression ( left , right , nameof ( Expression . NotEqual ) ) ;
@@ -615,6 +632,7 @@ public HasCountGreaterThanType(bool caseInsensitive = false, bool usesAll = fals
615632 }
616633
617634 public override string Operator ( ) => CaseInsensitive ? $ "{ Name } { CaseSensitiveAppendix } " : Name ;
635+ public override bool IsCountOperator ( ) => true ;
618636 public override Expression GetExpression < T > ( Expression left , Expression right , Type ? dbContextType )
619637 {
620638 return GetCountExpression ( left , right , nameof ( Expression . GreaterThan ) ) ;
@@ -628,6 +646,7 @@ public HasCountLessThanType(bool caseInsensitive = false, bool usesAll = false)
628646 }
629647
630648 public override string Operator ( ) => CaseInsensitive ? $ "{ Name } { CaseSensitiveAppendix } " : Name ;
649+ public override bool IsCountOperator ( ) => true ;
631650 public override Expression GetExpression < T > ( Expression left , Expression right , Type ? dbContextType )
632651 {
633652 return GetCountExpression ( left , right , nameof ( Expression . LessThan ) ) ;
@@ -641,6 +660,7 @@ public HasCountGreaterThanOrEqualType(bool caseInsensitive = false, bool usesAll
641660 }
642661
643662 public override string Operator ( ) => CaseInsensitive ? $ "{ Name } { CaseSensitiveAppendix } " : Name ;
663+ public override bool IsCountOperator ( ) => true ;
644664 public override Expression GetExpression < T > ( Expression left , Expression right , Type ? dbContextType )
645665 {
646666 return GetCountExpression ( left , right , nameof ( Expression . GreaterThanOrEqual ) ) ;
@@ -654,6 +674,7 @@ public HasCountLessThanOrEqualType(bool caseInsensitive = false, bool usesAll =
654674 }
655675
656676 public override string Operator ( ) => CaseInsensitive ? $ "{ Name } { CaseSensitiveAppendix } " : Name ;
677+ public override bool IsCountOperator ( ) => true ;
657678 public override Expression GetExpression < T > ( Expression left , Expression right , Type ? dbContextType )
658679 {
659680 return GetCountExpression ( left , right , nameof ( Expression . LessThanOrEqual ) ) ;
@@ -667,6 +688,7 @@ public HasType(bool caseInsensitive = false, bool usesAll = false) : base("^$",
667688 }
668689
669690 public override string Operator ( ) => CaseInsensitive ? $ "{ Name } { CaseSensitiveAppendix } " : Name ;
691+ public override bool IsCountOperator ( ) => false ;
670692 public override Expression GetExpression < T > ( Expression left , Expression right , Type ? dbContextType )
671693 {
672694 if ( left . Type . IsGenericType &&
@@ -689,6 +711,7 @@ public DoesNotHaveType(bool caseInsensitive = false, bool usesAll = false) : bas
689711 }
690712
691713 public override string Operator ( ) => CaseInsensitive ? $ "{ Name } { CaseSensitiveAppendix } " : Name ;
714+ public override bool IsCountOperator ( ) => false ;
692715 public override Expression GetExpression < T > ( Expression left , Expression right , Type ? dbContextType )
693716 {
694717 if ( left . Type . IsGenericType &&
@@ -711,6 +734,7 @@ public NotInType(bool caseInsensitive = false, bool usesAll = false) : base("!^^
711734 }
712735
713736 public override string Operator ( ) => CaseInsensitive ? $ "{ Name } { CaseSensitiveAppendix } " : Name ;
737+ public override bool IsCountOperator ( ) => false ;
714738 public override Expression GetExpression < T > ( Expression left , Expression right , Type ? dbContextType )
715739 {
716740 var leftType = left . Type ;
0 commit comments