enisn / AutoFilterer

AutoFilterer is a mini filtering framework library for dotnet. The main purpose of the library is to generate LINQ expressions for Entities over DTOs automatically. The first aim is to be compatible with Open API 3.0 Specifications
MIT License
458 stars 37 forks source link

String Not Contains Filter #46

Closed mehmetuken closed 2 years ago

enisn commented 2 years ago

As I understand, you're talking about something like below:

    [StringFilterOptions(StringFilterOption.NotContains)]
    public string Name { get; set; }

StringFilter calls a method, and each enum member presents a string method. But there is no method named 'NotContains', you implementing it requires architectural changes.

Instead of this custom development, I'll consider adding negativity to queries. like adding an exclamation mark at the beginning of the LINQ query.

x => x.Name.Contains(something) x => !x.Name.Contains(something)