How rcommon-team/rcommon works
RCommon is a modular .NET infrastructure library, not a standalone application: host applications compose its abstractions and provider packages through dependency injection. A representative request path dispatches a query, optionally validates it, invokes a handler, and uses a repository/provider to access data. The library also provides transactional outbox/inbox and saga support, event and messaging adapters, caching, blob storage, and cross-cutting domain, tenant, validation, serialization, email, and security capabilities. Provider-specific links and several capability branches are documented in the README; unsampled internals are not inferred.
Main entry points: IAggregateRepository.cs Aggregate repositories · OutboxEventRouter.cs Outbox event router · ITenantIdAccessor.cs Tenant context · QueryBus.cs Query bus
Components 25
Application services
- Query bus
Src/RCommon.ApplicationServices/Queries/QueryBus.cs - Validation service
Src/RCommon.ApplicationServices/Validation/ValidationService.cs - Query handlers
Src/RCommon.ApplicationServices/Queries/IQueryHandler.cs - State machines
Src/RCommon.Core/StateMachines/IStateMachine.cs
Persistence and domain
- Domain entities
Src/RCommon.Entities/AggregateRoot.cs - Aggregate repositories
Src/RCommon.Persistence/Crud/IAggregateRepository.cs - Data store factory
Src/RCommon.Persistence/IDataStoreFactory.cs - Outbox stores
Src/RCommon.Persistence/Outbox/IOutboxStore.cs
Events and messaging
- Outbox event router
Src/RCommon.Persistence/Outbox/OutboxEventRouter.cs - Event handling
Src/RCommon.Core/EventHandling/IEventBus.cs - Producer subscriptions
Src/RCommon.Core/EventHandling/Producers/EventSubscriptionManager.cs
Infrastructure providers
- EF Core adapter
Src/RCommon.EfCore/Crud/EFCoreAggregateRepository.cs - Dapper adapter
Src/RCommon.Dapper/Crud/DapperAggregateRepository.cs - Linq2Db adapter
Src/RCommon.Linq2Db/Crud/Linq2DbAggregateRepository.cs - Broker adapters
Src/RCommon.MassTransit/Producers/PublishWithMassTransitEventProducer.cs - Azure blob adapter
Src/RCommon.Azure.Blobs/AzureBlobStorageService.cs - Amazon S3 adapter
Src/RCommon.Amazon.S3Objects/AmazonS3StorageService.cs
Cross-cutting services
- Cache abstraction
Src/RCommon.Caching/ICacheService.cs - Repository cache
Src/RCommon.Persistence.Caching/Crud/CachingGraphRepository.cs - Tenant context
Src/RCommon.Security/Claims/ITenantIdAccessor.cs - Blob storage API
Src/RCommon.Blobs/IBlobStorageService.cs - JSON serialization
Src/RCommon.Json/IJsonSerializer.cs - Email service
Src/RCommon.Emailing/IEmailService.cs - Principal and claims
Src/RCommon.Security/Claims/ICurrentPrincipalAccessor.cs
Other components
- Host application
Connections 29
- Host application → Query bus: dispatches query
- Query bus → Validation service: validates optionally
Src/RCommon.ApplicationServices/Queries/QueryBus.cs - Query bus → Query handlers: invokes handler
Src/RCommon.ApplicationServices/Queries/QueryBus.cs - Query handlers → Aggregate repositories: uses repository
- Aggregate repositories → EF Core adapter: implemented by
Src/RCommon.EfCore/Crud/EFCoreAggregateRepository.cs - Aggregate repositories → Dapper adapter: implemented by
Src/RCommon.Dapper/Crud/DapperAggregateRepository.cs - Aggregate repositories → Linq2Db adapter: implemented by
Src/RCommon.Linq2Db/Crud/Linq2DbAggregateRepository.cs - EF Core adapter → Data store factory: resolves store
Src/RCommon.EfCore/Crud/EFCoreAggregateRepository.cs - Dapper adapter → Data store factory: resolves store
Src/RCommon.Dapper/Crud/DapperAggregateRepository.cs - Linq2Db adapter → Data store factory: resolves store
Src/RCommon.Linq2Db/Crud/Linq2DbAggregateRepository.cs - Aggregate repositories → Domain entities: persists aggregates
- EF Core adapter → Tenant context: filters by tenant
Src/RCommon.EfCore/Crud/EFCoreAggregateRepository.cs - Dapper adapter → Tenant context: filters by tenant
Src/RCommon.Dapper/Crud/DapperAggregateRepository.cs - Linq2Db adapter → Tenant context: sets tenant
Src/RCommon.Linq2Db/Crud/Linq2DbAggregateRepository.cs - Domain entities → Outbox event router: buffers events
- Outbox event router → Outbox stores: persists messages
Src/RCommon.Persistence/Outbox/OutboxEventRouter.cs - Outbox event router → Producer subscriptions: filters producers
Src/RCommon.Persistence/Outbox/OutboxEventRouter.cs - Outbox event router → Broker adapters: dispatches events
- Host application → Event handling: publishes events
- Event handling → Broker adapters: adapts to brokers
- Repository cache → Aggregate repositories: wraps repository
Src/RCommon.Persistence.Caching/Crud/CachingGraphRepository.cs - Repository cache → Cache abstraction: reads and writes cache
Src/RCommon.Persistence.Caching/Crud/CachingGraphRepository.cs - Host application → Blob storage API: stores blobs
- Blob storage API → Azure blob adapter: implemented by
Src/RCommon.Azure.Blobs/AzureBlobStorageService.cs - Blob storage API → Amazon S3 adapter: implemented by
Src/RCommon.Amazon.S3Objects/AmazonS3StorageService.cs - Host application → JSON serialization: configures serializer
- Host application → Email service: sends email
- Principal and claims → Tenant context: resolves tenant
Src/RCommon.Security/Claims/ITenantIdAccessor.cs - Host application → State machines: configures workflows