-
Notifications
You must be signed in to change notification settings - Fork 23
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
Support for case insensitive filtering for string #19
base: master
Are you sure you want to change the base?
Support for case insensitive filtering for string #19
Conversation
…r strings and operators - StartsWith, EndsWith, Contains and Doesnotcontain
support for this #15 |
src/Filter.cs
Outdated
/// Gets or sets the filtering logic. Can be set to "or" or "and". Set to null unless Filters is set. | ||
/// </summary> | ||
[DataMember(Name = "ignoreCase")] | ||
public bool ignoreCase { get; set; } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not use Pascal Case?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not use Pascal Case?
Thanks for finding out, missed to make it Pascal in hurry. Committing after correction.
Property name changed to Pascal case |
@@ -37,6 +37,12 @@ public class Filter | |||
[DataMember(Name = "logic")] | |||
public string Logic { get; set; } | |||
|
|||
/// <summary> | |||
/// Gets or sets the filtering logic. Can be set to "or" or "and". Set to null unless Filters is set. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This summary is required to adjust.
Number = 2, | ||
Identification = Guid.Parse("a3ee172c-fdf3-4390-9bb1-d5a70ccfbb3b"), | ||
Name = "CoCo", | ||
Introduce = "I'm CoCo", | ||
Salary = 2500, | ||
Weight = 69.2, | ||
Gender = Gender.M, | ||
Birthday = new DateTime(1986,10,10), | ||
Birthday = new DateTime(1986, 10, 9, 16, 0, 0), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you explain the reason for changing this test data value?
Number = 4, | ||
Identification = Guid.Parse("a4e918a9-46f9-4a13-8f37-e8771bf7dc5c"), | ||
Name = "Rock", | ||
Introduce = "I'm Rock", | ||
Salary = 1750, | ||
Weight = 82.1, | ||
Gender = Gender.M, | ||
Birthday = new DateTime(1976,11,6), | ||
Birthday = new DateTime(1976, 11, 5, 16, 0, 0), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as above.
@@ -55,16 +57,48 @@ public void InputParameter_SubPropertyContains_CheckResultCount() | |||
Assert.AreEqual(2, result2.Total); | |||
} | |||
|
|||
[Test] | |||
public void InputParameter_SubPropertyContains_Case_Insensitive_CheckResultCount() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you provide a sample of JSON string(with ignoreCase property) that request in a real scenario?
By the way, I found some references that indicated the case sensitivity depends on the database provider. For example, SQLite and PostgreSQL are case-sensitive by default, others like SQL Server and MySQL are case-insensitive. On the other hand, Use string.ToLower might cause a performance issue.
References: |
Added a boolean param in Filter to support case-insensitive filter for strings and operators - StartsWith, EndsWith, Contains and Doesnotcontain