AutoFilterer

0

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 compatibl…

Infrastructure

automation
aspnetcore
filter
automatic-filtering

Logo

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. Creating queries without writing any expression code is the most powerful feature that is provided. The first aim of AutoFilterer is to be compatible with Open API 3.0 Specifications, unlike oData & GraphQL.

This library does not generate database queries directly. It generates LINQ Expressions.

You can visit Wiki for documentation

Nuget WiKi CodeFactor Build status Gitmoji

Getting Started

  • Install AutoFilterer NuGet package from here.

Vsit visit documentation to learn how to use AutoFilterer.

Open in Visual Studio Code


Showcase

TRY LIVE DEMO now.

autofilterer showcase


Usage

A quick example is presented below. Reading Wiki is highly recommended for detailed features.

  • Create a filter model and make sure property names match to Entity properties.
public class ProductFilter : PaginationFilterBase
{
  public Range<double> Price { get; set; }

  [ToLowerContainsComparison]
  public string Name { get; set; }
  
  [StringFilteringOptions(StringFilterOption.Equals)]
  public string Locale { get; set; }
}
  public IActionResult GetProducts([FromQuery]ProductFilter filter)
  {
    var products = db.Products.ApplyFilter(filter).ToList();
    return Ok(products);
  }

Don't forget to visit Wiki for better understanding of usage.


AutoFilterer.Swagger

All parameters support OpenAPI 3.0 Specifications 👍

Improve your swagger documentation via using AutoFilterer.Swagger


AutoFilterer.Generators

AutoFilterer.Generators aims to generate filter objects from entities automatically via using dotnet source generators.

Visit documentation of Generators


Performance

See Benchmark Results from here


Stats

Alt