FxMap: an open-source .NET library that fills DTO fields from other services

by•

Sharing a free, open-source library I maintain for .NET microservices.

The problem: an order DTO has a UserId, and you end up calling the user service, batching the ids and copying Name and Email back by hand, again and again.

How FxMap does it: the service that owns the data says how an entity is exposed. In the DTO you write a profile: this key fills these fields, optionally with a small expression such as Country.Name. Then one call to MapDataAsync on a list sends one request per key, not one per object. It works over gRPC, NATS, RabbitMQ, Kafka, Azure Service Bus and AWS SQS, reads from EF Core or MongoDB, and has a HotChocolate (GraphQL) integration.

Honest limits: .NET only (8, 9 and 10), gRPC calls have a fixed 3 second timeout in the current version, and the test suite is 826 tests with about 62% line coverage. Load test numbers and a benchmark are on the Testing page of the docs.

I'd really like feedback on the expression syntax, and on whether keeping the profile on the client and the entity config on the owner feels natural to you.

Docs: - Code:

26 views

Add a comment

Replies

Be the first to reply

Have a question or a thought to share? Add a comment above to start the conversation.