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

Auto Filter Generators #23

Closed enisn closed 3 years ago

enisn commented 3 years ago

AutoFilterer Generators

AutoFilterer.Generators aims to generate filter objects automatically from entities via using [dotnet source generators](Introducing C# Source Generators | .NET Blog (microsoft.com)).

WARNING: This feature is beta for now and might will be have braking changes future.

Usage

BookFilter source code looks like:

  public partial class BookFilter : PaginationFilterBase
  {
    public string Title { get; set; }
    public Range<int> Year { get; set; }
    public Range<int> TotalPage { get; set; }
    public System.DateTime PublishTime { get; set; }
  }

Features

Generators tries to create best filter object that fit you requirements.

[AutoFilterDto("My.SpecialNamespace.Filters")]
public class MyAwesomeEntity
{
  /...
}