Custom filters/sorts case-insensitivity

This commit is contained in:
Biarity
2018-02-11 13:35:33 +10:00
parent bafee2314e
commit 3068c476e1
5 changed files with 21 additions and 7 deletions

View File

@@ -284,7 +284,8 @@ namespace Sieve.Services
private IQueryable<TEntity> ApplyCustomMethod<TEntity>(IQueryable<TEntity> result, string name, object parent, object[] parameters, object[] optionalParameters = null)
{
var customMethod = parent?.GetType()
.GetMethod(name);
.GetMethod(name,
_options.Value.CaseSensitive ? BindingFlags.Default : BindingFlags.IgnoreCase | BindingFlags.Public | BindingFlags.Instance);
if (customMethod != null)
{

View File

@@ -2,7 +2,7 @@
<package xmlns="http://schemas.microsoft.com/packaging/2013/05/nuspec.xsd">
<metadata>
<id>Sieve</id>
<version>1.3.8</version>
<version>1.3.9</version>
<title>Sieve</title>
<authors>Biarity</authors>
<owners>Biarity</owners>
@@ -13,7 +13,7 @@
<description>
Sieve is a simple, clean, and extensible framework for .NET Core that adds sorting, filtering, and pagination functionality out of the box. Most common use case would be for serving ASP.NET Core GET queries. Documentation available on GitHub: https://github.com/Biarity/Sieve/
</description>
<releaseNotes>Filter before sort</releaseNotes>
<releaseNotes>Fluent API v1 and case-insensitive operators</releaseNotes>
<copyright>Copyright 2018</copyright>
<tags>aspnetcore filter sort page paginate sieve search</tags>
<dependencies>