From 304e8f4f6070684d2fb5b159e7eddb7c00f88b78 Mon Sep 17 00:00:00 2001 From: Biarity Date: Thu, 8 Feb 2018 09:13:06 +1000 Subject: [PATCH] No custom operators for simplicity --- Sieve/Models/FilterTerm.cs | 23 ++++------------------- Sieve/Sieve.nuspec | 4 ++-- 2 files changed, 6 insertions(+), 21 deletions(-) diff --git a/Sieve/Models/FilterTerm.cs b/Sieve/Models/FilterTerm.cs index 5ad7916..8283b22 100644 --- a/Sieve/Models/FilterTerm.cs +++ b/Sieve/Models/FilterTerm.cs @@ -45,9 +45,10 @@ namespace Sieve.Models } } - // Custom operator - var tokens = _filter.Split(' '); - return tokens.Length > 1 ? tokens[1] : ""; + // Custom operators not supported + // var tokens = _filter.Split(' '); + // return tokens.Length > 2 ? tokens[1] : ""; + return ""; } } @@ -65,36 +66,20 @@ namespace Sieve.Models { switch (Operator.Trim().ToLower()) { - case "equals": - case "eq": case "==": return FilterOperator.Equals; - case "notequals": - case "nq": case "!=": return FilterOperator.NotEquals; - case "lessthan": - case "lt": case "<": return FilterOperator.LessThan; - case "greaterthan": - case "gt": case ">": return FilterOperator.GreaterThan; - case "greaterthanorequalto": - case "gte": case ">=": return FilterOperator.GreaterThanOrEqualTo; - case "lessthanorequalto": - case "lte": case "<=": return FilterOperator.LessThanOrEqualTo; - case "contains": - case "co": case "@=": return FilterOperator.Contains; - case "startswith": - case "sw": case "_=": return FilterOperator.StartsWith; default: diff --git a/Sieve/Sieve.nuspec b/Sieve/Sieve.nuspec index 37f28a8..a94345a 100644 --- a/Sieve/Sieve.nuspec +++ b/Sieve/Sieve.nuspec @@ -2,7 +2,7 @@ Sieve - 1.3.5 + 1.3.7 Sieve Biarity Biarity @@ -13,7 +13,7 @@ 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/ - Fixed custom oeprator bug + Custom operators no longer supported for simplicity Copyright 2018 aspnetcore filter sort page paginate sieve search