Skip to content

Commit 7a67163

Browse files
committed
Update filters to use CurrentCulture string comparison
Updated all string comparison operations in `ObjectListFilter` and filter parsing logic to use `StringComparer.CurrentCulture` or `StringComparer.CurrentCultureIgnoreCase` instead of `Ordinal`/`OrdinalIgnoreCase`. Adjusted related test expectations to match. This ensures string-based filters now respect the current culture's case rules.
1 parent d07629d commit 7a67163

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

src/FSharp.Data.GraphQL.Server.Middleware/ObjectListFilterModule.fs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,16 +54,16 @@ module ObjectListFilter =
5454
let ( !!! ) filter = Not filter
5555

5656
/// Creates a new ObjectListFilter representing a case-insensitive EQUALS operation on a string value.
57-
let ( ===~ ) fname (value : string) = Equals ({ FieldName = fname; Value = value }, StringComparer.OrdinalIgnoreCase)
57+
let ( ===~ ) fname (value : string) = Equals ({ FieldName = fname; Value = value }, StringComparer.CurrentCultureIgnoreCase)
5858

5959
/// Creates a new ObjectListFilter representing a case-insensitive STARTS WITH operation on a string value.
60-
let ( =@@~ ) fname (value : string) = StartsWith ({ FieldName = fname; Value = value }, StringComparer.OrdinalIgnoreCase)
60+
let ( =@@~ ) fname (value : string) = StartsWith ({ FieldName = fname; Value = value }, StringComparer.CurrentCultureIgnoreCase)
6161

6262
/// Creates a new ObjectListFilter representing a case-insensitive ENDS WITH operation on a string value.
63-
let ( @@=~ ) fname (value : string) = EndsWith ({ FieldName = fname; Value = value }, StringComparer.OrdinalIgnoreCase)
63+
let ( @@=~ ) fname (value : string) = EndsWith ({ FieldName = fname; Value = value }, StringComparer.CurrentCultureIgnoreCase)
6464

6565
/// Creates a new ObjectListFilter representing a case-insensitive CONTAINS operation on a string value.
66-
let ( @=@~ ) fname (value : string) = Contains ({ FieldName = fname; Value = value }, StringComparer.OrdinalIgnoreCase)
66+
let ( @=@~ ) fname (value : string) = Contains ({ FieldName = fname; Value = value }, StringComparer.CurrentCultureIgnoreCase)
6767

6868
let private genericWhereMethod =
6969
let queryableType = typeof<Queryable>

0 commit comments

Comments
 (0)