Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Case in-sensitive filtering for List<string> does not work #193

Closed
moxplod opened this issue Aug 4, 2024 · 3 comments
Closed

Case in-sensitive filtering for List<string> does not work #193

moxplod opened this issue Aug 4, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@moxplod
Copy link
Contributor

moxplod commented Aug 4, 2024

Version

2.14.2

Details

I am doing filtering on List primitive type on postgres.
It works case-sensitive.

However, the case-insensitive filtering does not work.

Steps to reproduce

From the example -
#167 (comment)

.ApplyFiltering("FavouriteColors=blue/i")

Does not work.

@moxplod moxplod added the bug Something isn't working label Aug 4, 2024
@alirezanet
Copy link
Owner

Hi @moxplod,

Could you please test this in the latest preview versions as well? Since this feature has changed a lot recently, the issue might be resolved. If not, I'll look into it in a few days.

@moxplod
Copy link
Contributor Author

moxplod commented Aug 4, 2024

I just forked the repository and created a test to try it there. Verified that it's not working there.

   [Fact]
   public void ApplyFiltering_WithoutMapper_ShouldGenerateMappingsForListOfStrings_CaseInsensitive()
   {
      // arrange
      var dataSource = new List<Test>()
      {
         new() {FavouriteColorList = ["Green", "Blue"]},
         new() {FavouriteColorList = ["White", "Yellow"]},
      }.AsQueryable();

      var mapper = new GridifyMapper<Test>()
         .AddMap("FavouriteColorList", w => w.FavouriteColorList.Select(Param_0 => Param_0));
      var expected = dataSource.ApplyFiltering("FavouriteColorList=red/i|FavouriteColorList=blue/i", mapper);

      // act
      var actual = dataSource.ApplyFiltering("FavouriteColorList=red/i|FavouriteColorList=blue/i");

      // assert
      Assert.Equal(expected.ToString(), actual.ToString());
      var actualList = actual.ToList();
      Assert.Equal(expected.ToList(), actualList);
      Assert.Single(actualList);
   }

moxplod added a commit to moxplod/Gridify that referenced this issue Aug 4, 2024
alirezanet added a commit that referenced this issue Aug 16, 2024
* New feature - #193

* PR refactors

* fix: issue 193 and case sensitivity support improvements

* test: add string operator test cases

* fix: other string operators case insensitive search

---------

Co-authored-by: AliReZa Sabouri <alirezanet@outlook.com>
@moxplod
Copy link
Contributor Author

moxplod commented Aug 22, 2024

This needs to be reopened.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants