mirror of
https://github.com/Biarity/Sieve.git
synced 2024-11-21 21:12:50 +01:00
Fixes #28
This commit is contained in:
parent
d149721627
commit
abb7029c70
@ -174,6 +174,7 @@ namespace Sieve.Services
|
||||
filterTerm.Value
|
||||
};
|
||||
result = ApplyCustomMethod(result, filterTermName, _customFilterMethods, parameters, dataForCustomMethods);
|
||||
|
||||
}
|
||||
}
|
||||
if (outerExpression == null)
|
||||
@ -181,6 +182,10 @@ namespace Sieve.Services
|
||||
outerExpression = innerExpression;
|
||||
continue;
|
||||
}
|
||||
if (innerExpression == null)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
outerExpression = Expression.And(outerExpression, innerExpression);
|
||||
}
|
||||
return outerExpression == null
|
||||
|
@ -1,8 +1,8 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>netstandard2.0</TargetFramework>
|
||||
<Version>2.1.0</Version>
|
||||
<Version>2.1.2</Version>
|
||||
<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>
|
||||
<Copyright>Copyright 2018</Copyright>
|
||||
@ -10,7 +10,7 @@
|
||||
<PackageProjectUrl>https://github.com/Biarity/Sieve</PackageProjectUrl>
|
||||
<PackageIconUrl>https://emojipedia-us.s3.amazonaws.com/thumbs/240/twitter/120/alembic_2697.png</PackageIconUrl>
|
||||
<RepositoryUrl></RepositoryUrl>
|
||||
<PackageReleaseNotes>Fix OR conditions and better SQL Server support</PackageReleaseNotes>
|
||||
<PackageReleaseNotes>Fix issue #28</PackageReleaseNotes>
|
||||
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
|
||||
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
|
||||
<Authors>Biarity</Authors>
|
||||
|
@ -152,6 +152,34 @@ namespace SieveUnitTests
|
||||
Assert.IsTrue(result.Count() == 3);
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public void CustomFiltersMixedWithUsualWork1()
|
||||
{
|
||||
var model = new SieveModel()
|
||||
{
|
||||
Filters = "Isnew,CategoryId==2",
|
||||
};
|
||||
|
||||
var result = _processor.Apply(model, _posts);
|
||||
|
||||
Assert.IsTrue(result.Any(p => p.Id == 3));
|
||||
Assert.IsTrue(result.Count() == 1);
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public void CustomFiltersMixedWithUsualWork2()
|
||||
{
|
||||
var model = new SieveModel()
|
||||
{
|
||||
Filters = "CategoryId==2,Isnew",
|
||||
};
|
||||
|
||||
var result = _processor.Apply(model, _posts);
|
||||
|
||||
Assert.IsTrue(result.Any(p => p.Id == 3));
|
||||
Assert.IsTrue(result.Count() == 1);
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public void MethodNotFoundExceptionWork()
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user