BlogDoFT.Libs.EntityFramework.CodeGenerator.Abstractions
10.1.0
dotnet add package BlogDoFT.Libs.EntityFramework.CodeGenerator.Abstractions --version 10.1.0
NuGet\Install-Package BlogDoFT.Libs.EntityFramework.CodeGenerator.Abstractions -Version 10.1.0
<PackageReference Include="BlogDoFT.Libs.EntityFramework.CodeGenerator.Abstractions" Version="10.1.0" />
<PackageVersion Include="BlogDoFT.Libs.EntityFramework.CodeGenerator.Abstractions" Version="10.1.0" />
<PackageReference Include="BlogDoFT.Libs.EntityFramework.CodeGenerator.Abstractions" />
paket add BlogDoFT.Libs.EntityFramework.CodeGenerator.Abstractions --version 10.1.0
#r "nuget: BlogDoFT.Libs.EntityFramework.CodeGenerator.Abstractions, 10.1.0"
#:package BlogDoFT.Libs.EntityFramework.CodeGenerator.Abstractions@10.1.0
#addin nuget:?package=BlogDoFT.Libs.EntityFramework.CodeGenerator.Abstractions&version=10.1.0
#tool nuget:?package=BlogDoFT.Libs.EntityFramework.CodeGenerator.Abstractions&version=10.1.0
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>StringFilterAttributeNumericFilterAttributeTemporalFilterAttributeBooleanFilterAttributeComparisonOperatorenum
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)
Versioning
Starting with v10.0.0, this library's version numbering follows the major version of the .NET runtime it targets. For example, this version is compatible with .NET 10, so the major version is 10 — this explains the jump from the previous 1.x version series.
| Product | Versions 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. |
-
.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 |
|---|---|---|
| 10.1.0 | 88 | 9/14/2026 |
| 10.0.1 | 87 | 9/14/2026 |
| 10.0.0 | 90 | 9/13/2026 |
| 1.14.0 | 92 | 9/13/2026 |
| 1.13.0 | 88 | 9/13/2026 |
| 1.12.0 | 126 | 8/27/2026 |
| 1.11.0 | 124 | 8/27/2026 |
| 1.10.0 | 400 | 11/16/2025 |
| 1.9.0 | 290 | 11/5/2025 |
| 1.8.0 | 278 | 11/3/2025 |
| 1.7.0 | 261 | 11/3/2025 |
| 1.6.3 | 276 | 10/21/2025 |
| 1.6.2 | 261 | 10/21/2025 |
| 1.6.1 | 253 | 10/21/2025 |
| 1.6.0 | 258 | 10/21/2025 |