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

Markup Goals #18

Open enisn opened 3 years ago

enisn commented 3 years ago

The Goal

Future of AutoFilterer aims to be a markup design pattern instead of using comparisons and binary operations.

Features

There are some planned features will be included in v3

Chaining Attributes

AutoFilterer will allow chaining multiple filter attributes with Binary operator attributes such as And & Or. See following example

public MyFilterDto : FilterBase
{
    [StringFilterOptions(StringFilterOption.Contains)]
    [Or]
    [StringFilterOptions(StringFilterOption.StartsWith)]
    public string Title { get; set; }
}

Comparision Selection

AutoFilterer will allow choosing target property for comparison type. For example, your ToLowerContains comparison will be applied to Title but, Equal filter will be applied to Language

public MyFilterDto : FilterBase
{
    [CompareString(StringFilterOption.Contains, "Description")]
    [And]
    [CompareOperator(OperatorType.Equal, "Title")]
    public string Search { get; set; }
}