Skip to content

About

EF Core extension library published to NuGet as SimplyWorks.EfCoreExtensions

Topics

Resources

Code of conduct

Contributing

Stars

5 stars

Watchers

3 watching

Forks

Repository files navigation

GitHub Actions NuGet License: MIT

Package Version
SimplyWorks.EfCoreExtensions NuGet

Overview

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.

Main Features

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.

Projects

  • SW.EfCoreExtensions: Main EF Core extensions library.
  • SW.EfCoreExtensions.PgSql: PostgreSQL-specific extensions.
  • SW.EfCoreExtensions.UnitTests: Unit tests for the extensions.

License

This project is licensed under the MIT License. See LICENSE for details.

Build & CI

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>

PropertyBuilderExtensions.cs

RelationalDbType.cs

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.

Query shaping

RowProjection.Of<T>(columns) / RowProjection.Many<T, TChild>(...): project to object[] 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 (escaped ILIKE in PgSql).

Getting support 👷

If you encounter any bugs, don't hesitate to submit an issue. We'll get back to you promptly!

About

EF Core extension library published to NuGet as SimplyWorks.EfCoreExtensions

Topics

Resources

Code of conduct

Contributing

Stars

5 stars

Watchers

3 watching

Forks

Releases

Packages

Used by

Contributors

Languages