FxMap.EntityFrameworkCore
4.1.1
dotnet add package FxMap.EntityFrameworkCore --version 4.1.1
NuGet\Install-Package FxMap.EntityFrameworkCore -Version 4.1.1
<PackageReference Include="FxMap.EntityFrameworkCore" Version="4.1.1" />
<PackageVersion Include="FxMap.EntityFrameworkCore" Version="4.1.1" />
<PackageReference Include="FxMap.EntityFrameworkCore" />
paket add FxMap.EntityFrameworkCore --version 4.1.1
#r "nuget: FxMap.EntityFrameworkCore, 4.1.1"
#:package FxMap.EntityFrameworkCore@4.1.1
#addin nuget:?package=FxMap.EntityFrameworkCore&version=4.1.1
#tool nuget:?package=FxMap.EntityFrameworkCore&version=4.1.1
<p align="center"> <img src="https://raw.githubusercontent.com/quyvu01/FxMap/main/FxMap.png" alt="FxMap" width="96" /> </p>
<h1 align="center">FxMap.EntityFrameworkCore</h1>
<p align="center"> Entity Framework Core data provider for FxMap — answers FxMap requests straight from your <code>DbContext</code>. </p>
<p align="center"> <a href="https://www.nuget.org/packages/FxMap.EntityFrameworkCore"><img alt="NuGet" src="https://img.shields.io/nuget/v/FxMap.EntityFrameworkCore.svg" /></a> <a href="https://www.nuget.org/packages/FxMap.EntityFrameworkCore"><img alt="Downloads" src="https://img.shields.io/nuget/dt/FxMap.EntityFrameworkCore.svg" /></a> <a href="https://github.com/quyvu01/FxMap/blob/main/LICENSE"><img alt="License" src="https://img.shields.io/badge/license-Apache--2.0-blue.svg" /></a> </p>
<p align="center"> <a href="https://github.com/quyvu01/FxMap"><b>FxMap</b></a> · <a href="https://fxmapper.net"><b>Documentation</b></a> · <a href="https://github.com/quyvu01/TestFxMap-Demo"><b>Demo project</b></a> </p>
The owning service of an entity registers it with EntityConfigureOf<T> and lists its DbContexts. FxMap then turns
incoming requests (ids plus expressions) into one EF Core query per distributed key and returns only the requested values.
Installation
dotnet add package FxMap.EntityFrameworkCore
All FxMap.* packages must use the same version.
Usage
public sealed class UserDistributedKey : IDistributedKey;
// 1. Describe the entity: its id, default property and distributed key
public class UserConfig : EntityConfigureOf<User>
{
protected override void Configure()
{
Id(x => x.Id);
DefaultProperty(x => x.Name);
UseDistributedKey<UserDistributedKey>();
}
}
// 2. Register FxMap and the DbContext(s) that hold your entities
builder.Services.AddFxMap(cfg =>
{
cfg.AddEntitiesFromAssemblyContaining<SomeEntityAssemblyMarker>();
cfg.AddProfilesFromAssemblyContaining<SomeProfileAssemblyMarker>();
})
.AddEntityFrameworkCore(options =>
options.AddDbContexts(typeof(AppDbContext), typeof(ReportingDbContext)));
AddEntitiesFromAssemblyContaining (or AddEntityConfig<T>) must run before AddEntityFrameworkCore.
How requests are executed
- One query per request. All ids and all expressions of a request are answered by a single
AsNoTrackingquery with a projection, using the expression language (navigation, filters, aggregations, projections, indexers). - Several
DbContexts are supported. FxMap routes each entity to theDbContextthat exposes it as aDbSet. - Each query runs in its own DI scope, with its own
DbContext, so requests can run in parallel safely. It does not see uncommitted data held by the caller'sDbContextor transaction. - Ids are parsed to the entity's id type:
string,Guid,int,long,short,byte,decimal,double,floatand their unsigned / nullable forms, or any strongly typed id with anIStronglyTypeConverter<TId>registered. Ids that cannot be parsed are ignored. - Ids are answered the way they were sent.
"ABCD…",{…}orN-format Guids,"007"for7or" 7 "are found and matched back to the object that sent them (2.3.5+). - Aggregates over empty collections:
:countand:sumreturn0;:min,:maxand:avgreturnnull(2.3.5+). ExposedName(x => x.Email, "UserEmail")renames a property in expressions; the original name no longer resolves.
Related packages
| Package | Description | Documentation |
|---|---|---|
| Core | ||
| FxMap | FxMap core: profiles, entity configs, the mapper and the expression language | README |
| Data providers | ||
| FxMap.EntityFrameworkCore | Answers requests from an Entity Framework Core DbContext |
This document |
| FxMap.MongoDb | Answers requests from MongoDB collections | README |
| Integrations | ||
| FxMap.HotChocolate | Fills GraphQL response types through HotChocolate | README |
| Transports | ||
| FxMap.Grpc | gRPC transport | README |
| FxMap.Nats | NATS transport | README |
| FxMap.RabbitMq | RabbitMQ transport | README |
| FxMap.Kafka | Apache Kafka transport | README |
| FxMap.Azure.ServiceBus | Azure Service Bus transport (Standard / Premium tiers) | README |
| FxMap.Aws.Sqs | Amazon SQS transport | README |
| Tooling | ||
| FxMap.Analyzers | Roslyn analyzer that validates expression strings at compile time | README |
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. 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 is compatible. 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 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
- FxMap (>= 4.1.1)
- Microsoft.EntityFrameworkCore (>= 8.0.0)
-
net8.0
- FxMap (>= 4.1.1)
- Microsoft.EntityFrameworkCore (>= 8.0.0)
-
net9.0
- FxMap (>= 4.1.1)
- Microsoft.EntityFrameworkCore (>= 8.0.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 4.1.1 | 38 | 10/6/2026 |
| 4.1.0 | 50 | 10/5/2026 |
| 4.0.0 | 84 | 10/5/2026 |
| 3.0.0 | 150 | 10/2/2026 |
| 2.3.5 | 57 | 10/2/2026 |
| 2.3.4 | 48 | 10/2/2026 |
| 2.3.3 | 52 | 10/1/2026 |
| 2.3.2 | 73 | 10/1/2026 |
| 2.3.1 | 122 | 8/21/2026 |
| 2.3.0 | 147 | 6/16/2026 |
| 2.2.2 | 128 | 6/3/2026 |
| 2.2.1 | 127 | 5/31/2026 |
| 2.2.0 | 508 | 5/26/2026 |
| 2.1.1 | 123 | 5/26/2026 |
| 2.1.0 | 228 | 5/7/2026 |
| 2.0.1 | 119 | 4/5/2026 |
| 2.0.0 | 124 | 4/5/2026 |
| 1.0.3 | 135 | 3/15/2026 |
| 1.0.2 | 125 | 3/7/2026 |
| 1.0.1 | 119 | 3/6/2026 |