Maxsys.Core.Filtering 17.0.0

dotnet add package Maxsys.Core.Filtering --version 17.0.0
                    
NuGet\Install-Package Maxsys.Core.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.Core.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.Core.Filtering" Version="17.0.0" />
                    
Directory.Packages.props
<PackageReference Include="Maxsys.Core.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.Core.Filtering --version 17.0.0
                    
#r "nuget: Maxsys.Core.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.Core.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.Core.Filtering&version=17.0.0
                    
Install as a Cake Addin
#tool nuget:?package=Maxsys.Core.Filtering&version=17.0.0
                    
Install as a Cake Tool

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

License

Maxsys.Core.Filtering é a extensão do Maxsys.Core para filtros tipados (specification): classes de filtro fortemente tipadas (FilterBase/IFilter) que se traduzem em Expressions aplicadas à query, além das variantes de IRepository e IModelService/ModelServiceBase que consultam a partir de um TFilter.

Complementa (não substitui) a filtragem dinâmica via ColumnFilter do Maxsys.Core: use ColumnFilter/ListCriteria para grids dinâmicos estilo PrimeNG, e um TFilter tipado quando o filtro é um contrato de negócio explícito da API.

⚙️ Uso

// 1. Defina o filtro da entidade
public class ProductFilter : FilterBase<Guid, Product>
{
    public string? Name { get; set; }
    public PeriodFilter? CreatedAt { get; set; }

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

        if (CreatedAt?.MinValue is not null)
            AddExpression(p => p.CreatedAt >= CreatedAt.MinValue);

        if (Search is not null)
            AddSearchExpression(p => new[] { p.Name, p.Code });
    }
}

// 2. Repositório e service com filtro
public interface IProductRepository : IRepository<Product, ProductFilter>;

public class ProductService : ModelServiceBase<Product, IProductRepository, Guid, ProductFilter>
{
    // GetAsync(filter), ToListAsync(filter), GetListAsync(filter, criteria),
    // ToInfoListAsync(filter), CountAsync(filter), AnyAsync(filter)...
}

Inclui ainda blocos de construção para filtros: SearchTerm (busca textual com SearchTermModes), KeyList<TKey> (Include/Exclude de chaves), RangeFilter<T>/PeriodFilter (faixas e períodos) e ActiveTypes.

💡 Este pacote define os contratos e bases. A implementação EF Core do repositório (RepositoryBase<TEntity, TFilter>) vive em Maxsys.Data.Filtering — ou implemente IRepository<TEntity, TFilter> você mesmo para outro provedor de dados.

🎯 Target

.NET 10

🔗 Dependências

  • Maxsys.Core

✒️ 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 (1)

Showing the top 1 NuGet packages that depend on Maxsys.Core.Filtering:

Package Downloads
Maxsys.Data.Filtering

Extensão Maxsys.Data para filtros tipados (specification): RepositoryBase<TEntity, TFilter> (EF Core) implementando o IRepository com filtro de Maxsys.Core.Filtering. (.NET 10)

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
17.0.0 96 8/17/2026