EFCore.ComplexIndexes
1.0.2
See the version list below for details.
dotnet add package EFCore.ComplexIndexes --version 1.0.2
NuGet\Install-Package EFCore.ComplexIndexes -Version 1.0.2
<PackageReference Include="EFCore.ComplexIndexes" Version="1.0.2" />
<PackageVersion Include="EFCore.ComplexIndexes" Version="1.0.2" />
<PackageReference Include="EFCore.ComplexIndexes" />
paket add EFCore.ComplexIndexes --version 1.0.2
#r "nuget: EFCore.ComplexIndexes, 1.0.2"
#:package EFCore.ComplexIndexes@1.0.2
#addin nuget:?package=EFCore.ComplexIndexes&version=1.0.2
#tool nuget:?package=EFCore.ComplexIndexes&version=1.0.2
<p align="center"> <img width="300" height="300" align="center" alt="efcore-complexindexes-logo" src="https://github.com/user-attachments/assets/9b51234a-90e4-44af-91a3-443d159f6d1d" /> </p>
Index support for complex type properties in EF Core migrations — the missing piece for value object-driven architectures.
EF Core 8.0 introduced complex properties, but migration tooling doesn't automatically generate indexes for these nested value objects. This NuGet package bridges that gap with a clean, fluent API for defining single-column, composite, unique, and filtered indexes directly on complex type properties.
Why it matters:
- Value Object Indexing: Seamlessly add database indexes to properties buried inside complex types (e.g., Person.EmailAddress.Value)
- DDD-Friendly: Supports the Domain-Driven Design pattern of encapsulating logic in value objects without sacrificing database performance
- Migration-Aware: Automatically generates proper CREATE INDEX and DROP INDEX operations during EF Core migrations
- Flexible Filtering: Supports SQL WHERE clauses for filtered indexes (e.g., soft deletes)
- Composite Indexes: Define multi-column indexes spanning both scalar and nested properties with a single, intuitive expression
Quick Example:
builder.ComplexProperty(x => x.EmailAddress, c =>
c.Property(x => x.Value)
.HasComplexIndex(isUnique: true, filter: "deleted_at IS NULL")
);
builder.HasComplexCompositeIndex(x => new { x.Name, x.EmailAddress.Value }, isUnique: true);
The package integrates seamlessly with EF Core's design-time tooling, requiring zero additional ceremony—just configure and migrate.
| Product | Versions 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. |
-
net10.0
- Microsoft.EntityFrameworkCore.Abstractions (>= 10.0.0)
NuGet packages (2)
Showing the top 2 NuGet packages that depend on EFCore.ComplexIndexes:
| Package | Downloads |
|---|---|
|
EFCore.ComplexIndexes.PostgreSQL
PostgreSQL provider extensions for EFCore.ComplexIndexes — GIN, GiST, BRIN, SP-GiST, and Hash index support for complex type properties. |
|
|
SIL.Harmony
CRDT application library for building offline-first apps with Entity Framework Core. |
GitHub repositories
This package is not used by any popular GitHub repositories.
Now index generation is also kicking off in cases, where this package isn't directly referenced by the migration entry point assembly.