| Package | Version |
|---|---|
SimplyWorks.EfCoreExtensions |
This repository contains open-source Entity Framework Core extensions for .NET, provided by Simplify9. The main NuGet package is SimplyWorks.EfCoreExtensions, targeting net10.0 and licensed under MIT.
The extensions are organized by file and provide additional helpers for EF Core, including:
- ChangeTrackerExtensions.cs: Soft deletion, audit values, tenant values, domain event dispatching.
- DbContextExtensions.cs: Helpers for working with DbContext and relational types.
- EntityEntryExtensions.cs: Property setting utilities.
- EntityTypeBuilderExtensions.cs: Entity type builder helpers.
- ExpressionExtensions.cs: Expression utilities.
- ICollectionExtensions.cs: Collection update helpers.
- IHostExtensions.cs: Host-related helpers.
- IQueryableOfTExtensions.cs: Queryable extensions and search conditions.
- ModelBuilderExtensions.cs: Model builder helpers.
- OwnedNavigationBuilderExtensions.cs: Owned navigation builder helpers.
See the source files for the full list of available extension methods and their usage.
SW.EfCoreExtensions: Main EF Core extensions library.SW.EfCoreExtensions.PgSql: PostgreSQL-specific extensions.SW.EfCoreExtensions.UnitTests: Unit tests for the extensions.
This project is licensed under the MIT License. See LICENSE for details.
GitHub Actions are used for CI/CD. See the badge above for status. NuGet packages are published automatically on new releases.
Contact> BuildContact<TOwner>
Dimensions> BuildDimensions<TOwner>
Weight> BuildWeight<TOwner>
Money> BuildMoney<TOwner>
Audit> BuildAudit<TOwner>
Search<TEntity>
SearchyCondition
SearchyFilter
SearchySort
Filter values are sent as SQL parameters, so a query shape compiles once and its plan is reused for every
value. Values convert to the field's type with the invariant culture, including Guid, enums (by name or
number) and booleans written as 1/0. Sorts accept any property type and dotted paths
(Customer.Address.City). In SimplyWorks.EfCoreExtensions.PgSql, StartsWith and Contains are
case-insensitive ILIKE, with %, _ and \ in the value matched literally.
RowProjection.Of<T>(columns)/RowProjection.Many<T, TChild>(...): project toobject[]rows of the chosen columns, nested collections included, so a query reads only what the caller asked for.
AfterKeyset/OrderByKeyset: keyset ("seek") paging; a deep page costs the same as the first.
ToPageAsync(size): a page and whether more rows follow, without a count.CountUpToAsync(limit): a count that stops at a limit ("10,000+").
QueryExpressions.Parameter(value, type)/QueryExpressions.TextMatch(field, text, kind): for code that builds its own filters, a value EF Core sends as a parameter, and the package's text match (escapedILIKEin PgSql).
If you encounter any bugs, don't hesitate to submit an issue. We'll get back to you promptly!