No custom operators for simplicity

This commit is contained in:
Biarity 2018-02-08 09:13:06 +10:00
parent ce04639f1c
commit 304e8f4f60
2 changed files with 6 additions and 21 deletions

View File

@ -45,9 +45,10 @@ namespace Sieve.Models
} }
} }
// Custom operator // Custom operators not supported
var tokens = _filter.Split(' '); // var tokens = _filter.Split(' ');
return tokens.Length > 1 ? tokens[1] : ""; // return tokens.Length > 2 ? tokens[1] : "";
return "";
} }
} }
@ -65,36 +66,20 @@ namespace Sieve.Models
{ {
switch (Operator.Trim().ToLower()) switch (Operator.Trim().ToLower())
{ {
case "equals":
case "eq":
case "==": case "==":
return FilterOperator.Equals; return FilterOperator.Equals;
case "notequals":
case "nq":
case "!=": case "!=":
return FilterOperator.NotEquals; return FilterOperator.NotEquals;
case "lessthan":
case "lt":
case "<": case "<":
return FilterOperator.LessThan; return FilterOperator.LessThan;
case "greaterthan":
case "gt":
case ">": case ">":
return FilterOperator.GreaterThan; return FilterOperator.GreaterThan;
case "greaterthanorequalto":
case "gte":
case ">=": case ">=":
return FilterOperator.GreaterThanOrEqualTo; return FilterOperator.GreaterThanOrEqualTo;
case "lessthanorequalto":
case "lte":
case "<=": case "<=":
return FilterOperator.LessThanOrEqualTo; return FilterOperator.LessThanOrEqualTo;
case "contains":
case "co":
case "@=": case "@=":
return FilterOperator.Contains; return FilterOperator.Contains;
case "startswith":
case "sw":
case "_=": case "_=":
return FilterOperator.StartsWith; return FilterOperator.StartsWith;
default: default:

View File

@ -2,7 +2,7 @@
<package xmlns="http://schemas.microsoft.com/packaging/2013/05/nuspec.xsd"> <package xmlns="http://schemas.microsoft.com/packaging/2013/05/nuspec.xsd">
<metadata> <metadata>
<id>Sieve</id> <id>Sieve</id>
<version>1.3.5</version> <version>1.3.7</version>
<title>Sieve</title> <title>Sieve</title>
<authors>Biarity</authors> <authors>Biarity</authors>
<owners>Biarity</owners> <owners>Biarity</owners>
@ -13,7 +13,7 @@
<description> <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/ 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>
<releaseNotes>Fixed custom oeprator bug</releaseNotes> <releaseNotes>Custom operators no longer supported for simplicity</releaseNotes>
<copyright>Copyright 2018</copyright> <copyright>Copyright 2018</copyright>
<tags>aspnetcore filter sort page paginate sieve search</tags> <tags>aspnetcore filter sort page paginate sieve search</tags>
<dependencies> <dependencies>