BlogDoFT.Libs.EntityFramework.CodeGenerator.Abstractions 1.10.0

dotnet add package BlogDoFT.Libs.EntityFramework.CodeGenerator.Abstractions --version 1.10.0
                    
NuGet\Install-Package BlogDoFT.Libs.EntityFramework.CodeGenerator.Abstractions -Version 1.10.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="BlogDoFT.Libs.EntityFramework.CodeGenerator.Abstractions" Version="1.10.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="BlogDoFT.Libs.EntityFramework.CodeGenerator.Abstractions" Version="1.10.0" />
                    
Directory.Packages.props
<PackageReference Include="BlogDoFT.Libs.EntityFramework.CodeGenerator.Abstractions" />
                    
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 BlogDoFT.Libs.EntityFramework.CodeGenerator.Abstractions --version 1.10.0
                    
#r "nuget: BlogDoFT.Libs.EntityFramework.CodeGenerator.Abstractions, 1.10.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 BlogDoFT.Libs.EntityFramework.CodeGenerator.Abstractions@1.10.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=BlogDoFT.Libs.EntityFramework.CodeGenerator.Abstractions&version=1.10.0
                    
Install as a Cake Addin
#tool nuget:?package=BlogDoFT.Libs.EntityFramework.CodeGenerator.Abstractions&version=1.10.0
                    
Install as a Cake Tool

BlogDoFT.Libs.EntityFramework.CodeGenerator.Abstractions

Strongly-typed attributes and enums used by the Predicate Generator.

These annotations are applied to filter DTOs so a source generator can emit ToPredicate() and HasFilter() methods.

Target Frameworks: netstandard2.0
C# Language Version: C# 11+ (required for generic attributes)


Contents

  • GeneratePredicateAttribute<TEntity>
  • StringFilterAttribute
  • NumericFilterAttribute
  • TemporalFilterAttribute
  • BooleanFilterAttribute
  • ComparisonOperator enum

Installation

Install it in the app project:

dotnet add package BlogDoFT.Libs.EntityFramework.CodeGenerator.Abstractions

Usage

Annotate your filter DTO with [GeneratePredicate<TEntity>] and mark each filterable property with the respective attribute.

using BlogDoFT.Libs.EntityFramework.CodeGenerator.Abstractions;

[GeneratePredicate<Domain.UserRecord>]
public partial class UserFilterDto
{
    [StringFilter(TargetProperty = nameof(Domain.UserRecord.Name), Order = 1)]
    public string? Name { get; init; }

    [StringFilter(TargetProperty = nameof(Domain.UserRecord.Email), Order = 2)]
    public string? Email { get; init; }

    [NumericFilter(TargetProperty = nameof(Domain.UserRecord.Age),
                   Operator = ComparisonOperator.GreaterThanOrEqual, Order = 3)]
    public int? MinimumAge { get; init; }

    [TemporalFilter(TargetProperty = nameof(Domain.UserRecord.CreatedAt),
                    Operator = ComparisonOperator.LessThanOrEqual, Order = 4)]
    public DateTime? CreatedUntil { get; init; }

    [BooleanFilter(TargetProperty = nameof(Domain.UserRecord.Active), Order = 5)]
    public bool? Active { get; init; }
}

The DTO must be partial. The generator adds the methods into the same type.

Behavior

Generated methods

Generated methods

  • Expression<Func<TEntity, bool>> ToPredicate()
  • bool HasFilter()

HasFilter() returns true if at least one annotated property holds a non-null value. ToPredicate() returns entity => true when all annotated values are null; otherwise it combines only the provided filters with logical AND.

String wildcards

When the string value contains %, the pattern is passed to the database (LIKE):

  • No %equality (field == value)
  • Ends with % → database pattern (e.g., value%)
  • Starts with % → database pattern (e.g., %value)
  • % in the middle or both sides → database pattern (e.g., %val%ue%)

This relies on the generator’s provider-aware output (see the Generator README).

Numeric and temporal operators

NumericFilterAttribute and TemporalFilterAttribute accept Operator: ComparisonOperator:

  • Equal, GreaterThan, LessThan, GreaterThanOrEqual, LessThanOrEqual.

Boolean properties

Always compared by equality.

Query Order

Usually, the where field orders matters - for database index usage.

Filters are composed by Order (if specified). Otherwise, DTO declaration order is used.

Requirements

C# 11+ (for generic attributes)

Works with EF Core 6/7/8+ (generator handles provider-specific differences)

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  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. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • .NETStandard 2.0

    • No dependencies.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on BlogDoFT.Libs.EntityFramework.CodeGenerator.Abstractions:

Package Downloads
BlogDoFT.Libs.EntityFramework.CodeGenerator

EF Core predicate source generator with provider-aware LIKE/ILIKE support.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.10.0 346 11/16/2025
1.9.0 251 11/5/2025
1.8.0 247 11/3/2025
1.7.0 233 11/3/2025
1.6.3 238 10/21/2025
1.6.2 230 10/21/2025
1.6.1 220 10/21/2025
1.6.0 221 10/21/2025