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