Skip to main content
Version: Next

NuGet Packages

All RCommon packages target .NET 8, .NET 9, and .NET 10 and are published to NuGet.org. The packages follow a layered design: a small set of foundation packages define abstractions and extension points, and provider-specific packages supply concrete implementations.

Foundation Packages

These packages define the abstractions that your application code programs against. They do not pull in any third-party libraries beyond the Microsoft.Extensions ecosystem.

PackageDescription
RCommon.CoreFluent AddRCommon() builder, in-memory event bus, IEventRouter, guard clauses, GUID generators, ISystemTime, extension methods, and reflection utilities
RCommon.EntitiesBusinessEntity<TKey>, AuditedEntity, transactional event tracking, IEntityEventTracker, soft delete (ISoftDelete), and multitenancy (IMultiTenant)
RCommon.ModelsCQRS contracts (ICommand, IQuery), event markers (IAsyncEvent, ISyncEvent), ExecutionResult, and pagination models
RCommon.PersistenceRepository pattern interfaces (IReadOnlyRepository, IWriteOnlyRepository, ILinqRepository, IGraphRepository, ISqlMapperRepository), unit of work, specification pattern, and IDataStoreFactory
RCommon.CachingICacheService, CacheKey, and builder contracts for memory and distributed caching providers
RCommon.EmailingIEmailService abstraction with a built-in SMTP implementation
RCommon.SecurityICurrentUser, ICurrentClient, ICurrentPrincipalAccessor, ITenantIdAccessor, claims extensions, and AuthorizationException
RCommon.MediatorIMediatorService, IMediatorAdapter, and request/notification marker interfaces for library-agnostic mediator usage
RCommon.ApplicationServicesCQRS command and query buses (ICommandBus, IQueryBus), handler registration, and IValidationService pipeline integration
RCommon.MultiTenancyWithMultiTenancy<T>() builder extension and IMultiTenantBuilder interface for registering tenancy providers

Persistence Providers

Drop-in implementations of the persistence abstractions for the ORM or SQL mapper of your choice.

PackageORM / DriverDescription
RCommon.EFCoreEntity Framework CoreEFCoreRepository<T>, RCommonDbContext, EFCorePerisistenceBuilder; full LINQ, eager loading, change tracking, and bulk delete
RCommon.DapperDapper + DommelDapperRepository<T>, RDbConnection, DapperPersistenceBuilder; expression-based CRUD via Dommel
RCommon.Linq2DbLinq2DbLinq2DbRepository<T>, RCommonDataConnection, Linq2DbPersistenceBuilder; full LINQ, eager loading via LoadWith, and paginated queries

Choosing a Persistence Provider

Best when you need full change tracking, navigation properties, eager loading with Include/ThenInclude, and rich LINQ queries. Supports IGraphRepository<T>, ILinqRepository<T>, IReadOnlyRepository<T>, and IWriteOnlyRepository<T>.

builder.Services.AddRCommon()
.WithPersistence<EFCorePerisistenceBuilder>(ef =>
{
ef.AddDbContext<AppDbContext>("AppDb", options =>
options.UseSqlServer(connectionString));
ef.SetDefaultDataStore(o => o.DefaultDataStoreName = "AppDb");
});

Caching Providers

PackageBacking StoreDescription
RCommon.MemoryCacheIMemoryCache / IDistributedCache (in-memory)Two ICacheService implementations: InMemoryCacheService (in-process) and DistributedMemoryCacheService
RCommon.RedisCacheRedis via StackExchange.RedisRedisCacheService implementing ICacheService with JSON serialization
RCommon.Persistence.CachingAny ICacheServiceCaching decorator repositories (CachingGraphRepository<T>, CachingLinqRepository<T>, CachingSqlMapperRepository<T>) wrapping any persistence provider
RCommon.Persistence.Caching.MemoryCacheMemoryWires InMemoryCacheService into the persistence caching decorators
RCommon.Persistence.Caching.RedisCacheRedisWires RedisCacheService into the persistence caching decorators

Messaging Providers

These packages bridge RCommon's IEventProducer and ISubscriber<T> abstractions to specific messaging libraries.

PackageLibraryDescription
RCommon.MassTransitMassTransitPublish/send event producers and MassTransitEventHandler<T> consumer bridge
RCommon.MassTransit.OutboxMassTransit + EF CoreEntity Framework Core outbox integration for durable MassTransit messaging
RCommon.MassTransit.StateMachinesMassTransitDictionary-based state machine adapter implementing IStateMachine<TState, TTrigger>
RCommon.WolverineWolverinePublish/send event producers and WolverineEventHandler<T> message handler bridge
RCommon.Wolverine.OutboxWolverine + EF CoreWolverine durable messaging outbox integration for RCommon

Mediator Providers

PackageLibraryDescription
RCommon.MediatrMediatRMediatRAdapter implementing IMediatorAdapter; event producers, notification/request handlers, and pipeline behaviors (logging, validation, unit of work)

Serialization

PackageLibraryDescription
RCommon.JsonIJsonSerializer abstraction used internally by caching and messaging packages
RCommon.SystemTextJsonSystem.Text.JsonIJsonSerializer implementation using System.Text.Json
RCommon.JsonNetNewtonsoft.JsonIJsonSerializer implementation using Newtonsoft.Json

Email Providers

PackageProviderDescription
RCommon.EmailingSMTPBuilt-in SMTP implementation (SmtpEmailService) and the IEmailService abstraction
RCommon.SendGridSendGrid APISendGridEmailService implementing IEmailService via the SendGrid API client

Security and Web

PackageDescription
RCommon.SecurityClaims-based ICurrentUser, ICurrentClient, ITenantIdAccessor, and principal accessor abstractions
RCommon.WebHttpContextCurrentPrincipalAccessor for ASP.NET Core; use WithClaimsAndPrincipalAccessorForWeb() instead of the non-web variant
RCommon.Authorization.WebSwashbuckle/OpenAPI operation filters that surface authorization requirements in Swagger UI

Multitenancy

PackageProviderDescription
RCommon.MultiTenancyBuilder abstraction (WithMultiTenancy<T>) for registering tenancy providers
RCommon.FinbuckleFinbuckle.MultiTenantFinbuckleTenantIdAccessor<TTenantInfo> bridging Finbuckle's tenant context to ITenantIdAccessor

Validation

PackageLibraryDescription
RCommon.FluentValidationFluentValidationFluentValidationProvider implementing IValidationProvider; resolves and runs all IValidator<T> instances from DI

State Machines

PackageLibraryDescription
RCommon.StatelessStatelessAdapter wrapping the Stateless library to implement IStateMachine<TState, TTrigger>

Blob Storage

PackageProviderDescription
RCommon.BlobsBlob storage abstraction layer
RCommon.Azure.BlobsAzure Blob StorageAzure Blob Storage implementation
RCommon.Amazon.S3ObjectsAmazon S3Amazon S3 implementation

Dependency Map

The following shows which foundation packages each provider depends on:

RCommon.Core
└─ RCommon.Entities
└─ RCommon.Persistence
├─ RCommon.EFCore
├─ RCommon.Dapper
└─ RCommon.Linq2Db

RCommon.Models
└─ RCommon.ApplicationServices
└─ RCommon.FluentValidation (optional validation pipeline)

RCommon.Mediator
└─ RCommon.Mediatr

RCommon.Core (IEventProducer, ISubscriber)
├─ RCommon.MassTransit
└─ RCommon.Wolverine

RCommon.Caching
├─ RCommon.MemoryCache
└─ RCommon.RedisCache

RCommon.Emailing
└─ RCommon.SendGrid

RCommon.Security
├─ RCommon.Web
└─ RCommon.MultiTenancy
└─ RCommon.Finbuckle
RCommonRCommon