FxMap 1.0.2
See the version list below for details.
dotnet add package FxMap --version 1.0.2
NuGet\Install-Package FxMap -Version 1.0.2
<PackageReference Include="FxMap" Version="1.0.2" />
<PackageVersion Include="FxMap" Version="1.0.2" />
<PackageReference Include="FxMap" />
paket add FxMap --version 1.0.2
#r "nuget: FxMap, 1.0.2"
#:package FxMap@1.0.2
#addin nuget:?package=FxMap&version=1.0.2
#tool nuget:?package=FxMap&version=1.0.2
FxMap
Effective distributed data mapping!
public string UserId { get; set; }
public string UserName { get; set; }
public string UserEmail { get; set; }
FxMap is an open-source library focused on FluentAPI-based data mapping. It streamlines data handling across services, reduces boilerplate code, and improves maintainability.
Full Documentation | Getting Started |Expression Language
All FxMap.* packages need to have the same version.
Quick Start
dotnet add package FxMap
// 1. Configure FxMap
builder.Services.AddFxMap(cfg =>
{
cfg.AddEntitiesFromAssemblyContaining<SomeEntityAssemblyMarker>();
cfg.AddProfilesFromAssemblyContaining<SomeProfileAssemblyMarker>();
});
// 2. Define a distributed key
public sealed class UserDistributedKey : IDistributedKey;
// 3. Configure the entity with FluentAPI
public class UserConfig : EntityConfigureOf<User>
{
protected override void Configure()
{
Id(x => x.Id);
DefaultProperty(x => x.Name);
UseDistributedKey<UserDistributedKey>(); // Or you want to absolute lose coupling, you can use: UseDistributedKey("UserDistributedKey")
ExposedName(x => x.Email, "UserEmail");
}
}
// 4. Define a profile for your DTO
public class UserResponseProfile : ProfileOf<UserResponse>
{
protected override void Configure()
{
UseDistributedKey<UserDistributedKey>() // Or you want to absolute lose coupling, you can use: UseDistributedKey("UserDistributedKey")
.Of(x => x.UserId)
.For(x => x.UserName)
.For(x => x.UserEmail, "Email");
}
}
Key Features
- FluentAPI-based Mapping: Declarative data fetching using
ProfileOf<T>andEntityConfigureOf<T> - Powerful Expression Language: SQL-like DSL for complex queries, filtering, aggregation, and projections
- Multiple Data Providers: Support for EF Core, MongoDB, and more
- Multiple Transports: gRPC, NATS, RabbitMQ, Kafka, Azure Service Bus, Amazon SQS
- GraphQL Integration: Seamless integration with HotChocolate
Expression Examples
public class UserResponseProfile : ProfileOf<UserResponse>
{
protected override void Configure()
{
UseDistributedKey<UserOfAttribute>()
.Of(x => x.UserId)
// Simple property access
.For(x => x.UserEmail, "Email")
// Navigation properties
.For(x => x.CountryName, "Country.Name")
// Filtering
.For(x => x.CompletedOrders, "Orders(Status = 'Done')")
// Aggregation
.For(x => x.TotalSpent, "Orders:sum(Total)")
// Projection
.For(x => x.UserDetails, "{Id, Name, Address.City as CityName}")
// GroupBy
.For(x => x.OrdersByStatus, "Orders:groupBy(Status).{Status, :count as Count}");
}
}
For complete expression syntax including filters, indexers, functions, aggregations, boolean functions, coalesce, ternary operators, and more, visit Expression Documentation.
Packages
| Package | Description | .NET |
|---|---|---|
| Core | ||
| FxMap | Core library | 8.0, 9.0, 10.0 |
| Data Providers | ||
| FxMap.EntityFrameworkCore | Entity Framework Core provider | 8.0, 9.0, 10.0 |
| FxMap.MongoDb | MongoDB provider | 8.0, 9.0, 10.0 |
| Integrations | ||
| FxMap.HotChocolate | HotChocolate GraphQL integration | 8.0, 9.0, 10.0 |
| Transports | ||
| FxMap.Grpc | gRPC transport | 8.0, 9.0, 10.0 |
| FxMap.Nats | NATS transport | 8.0, 9.0, 10.0 |
| FxMap.RabbitMq | RabbitMQ transport | 8.0, 9.0, 10.0 |
| FxMap.Kafka | Kafka transport | 8.0, 9.0, 10.0 |
| FxMap.Azure.ServiceBus | Azure Service Bus transport | 8.0, 9.0, 10.0 |
| FxMap.Aws.Sqs | Amazon SQS transport | 8.0, 9.0, 10.0 |
| Tooling | ||
| FxMap.Analyzers | Roslyn analyzers | 8.0, 9.0, 10.0 |
Documentation
Visit fxmapmapper.net for:
- Getting Started Guide
- Configuration Options
- Expression Language Reference
- Data Provider Setup
- Transport Configuration
Contributing
Contributions are welcome! Please visit our GitHub repository to:
- Report issues
- Submit pull requests
- Request features
License
This project is licensed under the Apache-2.0 license.
| 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
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 8.0.0)
- Microsoft.Extensions.Hosting.Abstractions (>= 8.0.0)
- Microsoft.Extensions.Logging (>= 8.0.0)
-
net8.0
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 8.0.0)
- Microsoft.Extensions.Hosting.Abstractions (>= 8.0.0)
- Microsoft.Extensions.Logging (>= 8.0.0)
-
net9.0
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 8.0.0)
- Microsoft.Extensions.Hosting.Abstractions (>= 8.0.0)
- Microsoft.Extensions.Logging (>= 8.0.0)
NuGet packages (10)
Showing the top 5 NuGet packages that depend on FxMap:
| Package | Downloads |
|---|---|
|
FxMap.MongoDb
FxMap extension. Use MongoDb as Data Querying |
|
|
FxMap.RabbitMq
FxMap.RabbitMq extension. Use RabbitMq as Data transporting |
|
|
FxMap.HotChocolate
HotChocolate extension. Integrate with HotChocolate |
|
|
FxMap.EntityFrameworkCore
FxMap extension. Use EntityFramework as Data Querying |
|
|
FxMap.Kafka
FxMap-Kafka extension. Use Kafka as Data transporting |
GitHub repositories
This package is not used by any popular GitHub repositories.