Maxsys.Data.Filtering 17.0.0

dotnet add package Maxsys.Data.Filtering --version 17.0.0
                    
NuGet\Install-Package Maxsys.Data.Filtering -Version 17.0.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Maxsys.Data.Filtering" Version="17.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Maxsys.Data.Filtering" Version="17.0.0" />
                    
Directory.Packages.props
<PackageReference Include="Maxsys.Data.Filtering" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Maxsys.Data.Filtering --version 17.0.0
                    
#r "nuget: Maxsys.Data.Filtering, 17.0.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Maxsys.Data.Filtering@17.0.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Maxsys.Data.Filtering&version=17.0.0
                    
Install as a Cake Addin
#tool nuget:?package=Maxsys.Data.Filtering&version=17.0.0
                    
Install as a Cake Tool

<div align="center"> <img src="logo.png" alt="drawing" width="128" /> <h1>Maxsys Data — Filtering</h1> </div>

License

Maxsys.Data.Filtering é a implementação EF Core dos filtros tipados (specification) do Maxsys.Core.Filtering: o RepositoryBase<TEntity, TFilter>, que implementa IRepository<TEntity, TFilter> aplicando filters.ApplyFilter(ref query) antes de cada consulta.

É a ponta que faltava entre os contratos (Maxsys.Core.Filtering) e o acesso a dados (Maxsys.Data): estenda-o em vez de RepositoryBase<TEntity> quando a entidade tiver um filtro tipado.

⚙️ Uso

// 1. Filtro tipado (Maxsys.Core.Filtering)
public class ProductFilter : FilterBase<Guid, Product>
{
    public string? Name { get; set; }

    public override void ConfigureExpressions()
    {
        if (!string.IsNullOrWhiteSpace(Name))
            AddExpression(p => p.Name.Contains(Name));
    }
}

// 2. Repositório concreto (este pacote)
public interface IProductRepository : IRepository<Product, ProductFilter>;

public class ProductRepository(AppDbContext context, IQueryProjector projector)
    : RepositoryBase<Product, ProductFilter>(context, projector), IProductRepository;

// 3. Service com filtro (Maxsys.Core.Filtering)
public class ProductService(IProductRepository repository, IUnitOfWork uow, IObjectMapper mapper)
    : ModelServiceBase<Product, IProductRepository, Guid, ProductFilter>(repository, uow, mapper);

As projeções (ToListAsync<TDestination>, GetAsync<TDestination>...) passam pelos mesmos chokepoints ApplyProjection do RepositoryBase<TEntity> — ou seja, via IQueryProjector (agnóstico de mapeador; use Maxsys.Mapping.AutoMapper ou implemente o seu).

🎯 Target

.NET 10

🔗 Dependências

  • Maxsys.Core.Filtering
  • Maxsys.Data

✒️ Autores

@MaxDolabella

🗝️ Licença

Este código possui licença MIT e está liberado para uso da maneira que se desejar.

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
17.0.0 88 8/17/2026