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
✨ Introduce multiple CompareTo attribute with IFilterableType #28
CompareTo attribute can be placed more than once over a property. Also you can pass a ÌFilterableType type parameter to define which comparison should be applied.
Example
You can do something like that:
public class MultipleTypeCompareToAndComparisonFilter : FilterBase
{
[CompareTo(typeof(ToLowerContainsComparisonAttribute), nameof(Book.Title))]
[CompareTo(typeof(EndsWithAttribute), nameof(Book.Author), CombineWith = CombineType.And)]
public string Search { get; set; }
public class EndsWithAttribute : StringFilterOptionsAttribute
{
public EndsWithAttribute() : base(StringFilterOption.EndsWith, StringComparison.InvariantCultureIgnoreCase)
{
}
}
}
Introduce Multiple CompareTo Attribute
CompareTo attribute can be placed more than once over a property. Also you can pass a
ÌFilterableType
type parameter to define which comparison should be applied.Example
You can do something like that:
This query will create something like that: