Skip to content

The in operator (^^, !^^) does not work on a property with HasConversion<string> #217

Closed

Description

@IngbertPalm

Problem

A property configured with HasConversion<string>() cannot be used with an array literal:

var config = new QueryKitConfiguration(c =>
{
    c.Property<WrappedIdRow>(x => x.Id).HasConversion<string>();
});

rows.ApplyQueryKitFilter("""Id ^^ ["2","3"]""", config);

It throws QueryKitParsingException: The ^^ operator needs a list value, for example ["a", "b"].
The right side is built for a single value through the (string) constructor, so the list is never
turned into an array of constants. The same happens with !^^, with a nullable struct, with a reference
type that has a (string) constructor, and when the property has a HasQueryName alias.

Expected

^^ and !^^ take a list. Each item is converted through the (string) constructor, so
Id ^^ ["2","3"] matches the rows whose id is 2 or 3.

I have a fix and tests ready and will open a PR.

Activity

  1. pdevito3 commented on Nov 2, 2026

    @pdevito3
    Owner

    hey there, thanks for reporting this and getting a PR up! i saw a few issues in the PR but went ahead and did a fix and got a patch release up that will resolve it. please let me know if you have any more problems though

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions