Giter Site home page Giter Site logo

Comments (4)

alirezanet avatar alirezanet commented on May 18, 2024 2

This feature is available in v2.1.0 . (readme)

var gq = new GridifyQuery() { Filter = "FirstName=John/i" };

from gridify.

alirezanet avatar alirezanet commented on May 18, 2024

Hi, thank you for your feedback
For now, Gridify doesn't have a case-insensitive operator yet but you can achieve case-insensitive search using the value convertors.

e.g

 var gq = new GridifyQuery { Filter = "FirstName=John" };
 var gm = new GridifyMapper<TestClass>()
            .AddMap("name", q => q.Name.ToLower() , c => c.ToLower());

         var query = Ds.ApplyFiltering(gq, gm);

Although I agree having an operator is simpler, The problem with having # operator in values is the character escaping, for example, the user can not easily search #John and must use something like \#John. but I'll look into this more.
I think having an /i operator at the end of each value could be a better option. (also regex is using the same operator)

e.g

var gQuery = new GridifyQuery() { Filter = "FirstName=John/i, Address=*st/i", OrderBy = "PhoneNumber" };

it's really rare if someone wants to have the John/i phrase to search. what do you think?

from gridify.

dcube9 avatar dcube9 commented on May 18, 2024

Hi, thank you for reply.

About symbol, I choice that without a specific reason.
The main problem (IMHO), is the string delimiter, every solution (# or /i or ...) have potentially a syntax problem.
But If we use a delimiter like ' (Apostrophe) for string in string you can write :
var gQuery = new GridifyQuery() { Filter = "FirstName='John'/i, Address=*st/i", OrderBy = "PhoneNumber" };
or
var gQuery = new GridifyQuery() { Filter = "FirstName=#'John', Address=*#'st'", OrderBy = "PhoneNumber" };

and when you need an apostrophe us ' .

what do you think?

from gridify.

alirezanet avatar alirezanet commented on May 18, 2024

The main problem (IMHO), is the string delimiter, every solution (# or /i or ...) have potentially a syntax problem.

You are completely right, but I think supporting the Apostrophe characters has the same problem. also because Gridify is being used in a lot of projects I should avoid any major breaking changes.
I remember I had this idea to support (Apostrophe) in version 1 but after few tests, I realized it's not helping too much.
this problem already exists for ( ) , | characters but it is easy enogth to solve. Regex.Replace(value, "([(),|])", "\\$1" ).
probably I'll only add an operator for case-insensitive support like # or /i ...
thank you for the contribution

from gridify.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.