FilterConditional 1.0.0

var fb = new ConditionalFilterGenerator<Your Entity>(Request.RequestUri.ParseQueryString(), new ConditionalFilterBuilder());

first example

fb.And<int>((e, i) => e.Id > i, "id")
               .And<int>((e, i) => e.Id < 4, "Id")
               .Or<string>((e, s) => e.Name.StartsWith(s), "name");
second example. This example contains in section 'Or' parameter type of boolean.
This parameter is talking if name-value 'Id' has been existed early in expression it is will not be used
NOTE: If name-value "id" or "name" not exists in the collection QueryString then expression will be skipped and will be used the expression 'Or'

fb.And<int, IEnumerable<string>>((e, i, a) => e.Id == i && a.Any(s => e.Name.StartsWith(s)), "id", "name")
               .Or<int>((e, i) => e.Id == 5, false, "id");

COMMENT:predicate result
var result = fb.GetConditional();

//In Controller will need add attribute
[ModelBinder(typeof(Your ModelBinder))]Expression<Func<Your Entity, bool>> pr  

Install-Package FilterConditional -Version 1.0.0
dotnet add package FilterConditional --version 1.0.0
<PackageReference Include="FilterConditional" Version="1.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add FilterConditional --version 1.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: FilterConditional, 1.0.0"
For F# scripts that support #r syntax, copy this into the source code to reference the package.


This package has no dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version History

Version Downloads Last updated
1.0.0 836 3/2/2016