Repository navigation
Home
FxMap is an open-source framework that focuses on FluentAPI-based distributed data mapping. It streamlines data handling across services, reduces boilerplate code, and improves maintainability in microservice architectures.
In microservice architectures, you often need to fetch related data from different services. Traditionally, this requires writing repetitive mapping code for each property.
// Without FxMap - Manual mapping required
public class OrderResponse
{
public string UserId { get; set; }
public string UserName { get; set; } // Need to manually fetch
public string UserEmail { get; set; } // Need to manually fetch
}
// Somewhere in your code...
var user = await _userService.GetUserAsync(order.UserId);
orderResponse.UserName = user.Name;
orderResponse.UserEmail = user.Email;With FxMap, you define entity configs and DTO profiles using FluentAPI, and the framework automatically handles all the data fetching and mapping for you.
// With FxMap - Declare once, map automatically
public class OrderResponseProfile : ProfileOf<OrderResponse>
{
protected override void Configure()
{
UseDistributedKey<UserDistributedKey>()
.Of(x => x.UserId)
.For(x => x.UserName)
.For(x => x.UserEmail, "Email");
}
}
// That's it! FxMap handles everything
var mapper = provider.GetService<IDistributedMapper>();
await mapper.MapDataAsync(orderResponse);
// UserName and UserEmail are now populated!90% Less Code
FxMap eliminates the need for manual mapping logic, freeing developers to focus on core functionality rather than data plumbing.
1
Define a distributed key — the shared contract between entity config and DTO profile.
public sealed class UserDistributedKey : IDistributedKey;2
Use EntityConfigureOf<T> to expose entity data, and ProfileOf<T> to declare what to map.
public class UserConfig : EntityConfigureOf<User>
{
protected override void Configure()
{
Id(x => x.Id);
DefaultProperty(x => x.Name);
UseDistributedKey<UserDistributedKey>();
}
}3
Declare which properties to auto-populate using ProfileOf.
public class OrderResponseProfile : ProfileOf<OrderResponse>
{
protected override void Configure()
{
UseDistributedKey<UserDistributedKey>()
.Of(x => x.UserId)
.For(x => x.UserName);
}
}Compiled expressions are 10x faster than reflection. Zero runtime overhead with compile-time expression trees.
Reduce mapping code by 90%. Configure with FluentAPI — no repetitive mapping logic required.
Works seamlessly with RabbitMQ, NATS, Kafka, gRPC, Azure Service Bus, and AWS SQS. Switch transports without code changes.
Built-in support for Entity Framework Core and MongoDB. Query across microservices with expression-based syntax.
Important
All FxMap.* packages need to have the same version to ensure compatibility.
Simplify data aggregation across multiple services without writing custom mapping code for each endpoint.
Automatically enrich events with data from other services as they flow through your message bus.
Compose rich response DTOs by automatically fetching related data from backend services.
Seamlessly integrate with HotChocolate to resolve nested fields across service boundaries.
Source: https://fxmapper.net/docs/ — the website is always the most up to date version.
Introduction
Getting Started
Configuration
- Service Registration
- Entities & Profiles
- Handlers
- Pipelines
- Strongly Typed IDs
- Error Handling
- Retry Policy
- Supervisor
- Telemetry
- Kestrel (HTTP/2)
- Analyzers
Expressions
- Overview
- Property Access
- Filters, Sorting & Paging
- Functions
- Aggregations
- Projections
- Coalesce & Ternary
- GroupBy
Data Providers
Transports
Integrations
Quality
AI Assistants
Migration
Release Notes