RCommon.Models
2.3.2-alpha.0.1
dotnet add package RCommon.Models --version 2.3.2-alpha.0.1
NuGet\Install-Package RCommon.Models -Version 2.3.2-alpha.0.1
<PackageReference Include="RCommon.Models" Version="2.3.2-alpha.0.1" />
<PackageVersion Include="RCommon.Models" Version="2.3.2-alpha.0.1" />
<PackageReference Include="RCommon.Models" />
paket add RCommon.Models --version 2.3.2-alpha.0.1
#r "nuget: RCommon.Models, 2.3.2-alpha.0.1"
#:package RCommon.Models@2.3.2-alpha.0.1
#addin nuget:?package=RCommon.Models&version=2.3.2-alpha.0.1&prerelease
#tool nuget:?package=RCommon.Models&version=2.3.2-alpha.0.1&prerelease
RCommon.Models
Shared model interfaces and base types for the RCommon framework, providing CQRS command and query contracts, event marker interfaces for sync/async dispatch, pagination models, and execution result types for conveying operation outcomes.
Features
ICommandandICommand<TResult>marker interfaces for CQRS command segregationIQueryandIQuery<TResult>marker interfaces for CQRS query segregationISerializableEvent,ISyncEvent, andIAsyncEventmarker interfaces for controlling event dispatch behaviorCommandResult<TExecutionResult>record for wrapping command handler outcomesExecutionResultwith static factory methods forSuccess()andFailed(errors)using cached singletonsPaginatedListModel<TSource>andPaginatedListModel<TSource, TOut>abstract records for building paginated DTOs with built-in page calculationPaginatedListRequestandSearchPaginatedListRequestfor encapsulating paging, sorting, and search parametersSortDirectionEnumfor specifying ascending, descending, or no-sort ordering- All models are decorated with
DataContract/DataMemberattributes for serialization support
Installation
dotnet add package RCommon.Models
Usage
using RCommon.Models.Commands;
using RCommon.Models.Queries;
using RCommon.Models.Events;
using RCommon.Models.ExecutionResults;
// Define a command
public class CreateOrderCommand : ICommand<IExecutionResult>
{
public string ProductName { get; set; }
public int Quantity { get; set; }
}
// Define an event for async dispatch
public class OrderCreatedEvent : IAsyncEvent
{
public Guid OrderId { get; set; }
}
// Return execution results from handlers
IExecutionResult result = ExecutionResult.Success();
IExecutionResult failure = ExecutionResult.Failed("Insufficient inventory", "Payment declined");
// Use paginated requests
var request = new SearchPaginatedListRequest
{
PageNumber = 1,
PageSize = 25,
SortBy = "CreatedDate",
SortDirection = SortDirectionEnum.Descending,
SearchString = "widget"
};
Key Types
| Type | Description |
|---|---|
IModel |
Base marker interface for all RCommon models |
ICommand / ICommand<TResult> |
Marker interfaces for CQRS commands, optionally specifying a result type |
IQuery / IQuery<TResult> |
Marker interfaces for CQRS queries, optionally specifying a result type |
ISerializableEvent |
Marker interface for events that can be serialized across process boundaries |
ISyncEvent |
Marker for events dispatched and handled synchronously within the same process |
IAsyncEvent |
Marker for events dispatched asynchronously via a message bus or queue |
IExecutionResult |
Represents the outcome of an operation with an IsSuccess flag |
ExecutionResult |
Abstract base with Success() and Failed() factory methods |
CommandResult<TExecutionResult> |
Wraps an execution result returned from a command handler |
PaginatedListModel<TSource> |
Abstract paginated DTO with page size, count, and navigation properties |
PaginatedListRequest |
Base request with page number, page size, sort field, and sort direction |
SearchPaginatedListRequest |
Extends PaginatedListRequest with a free-text SearchString property |
Documentation
For full documentation, visit rcommon.com.
Related Packages
- RCommon.Core - Foundation package with event bus, builder pattern, guards, and extensions
- RCommon.Entities - Domain entity base classes with auditing and transactional event tracking
License
Licensed under the Apache License, Version 2.0.
| 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
- No dependencies.
-
net8.0
- No dependencies.
-
net9.0
- No dependencies.
NuGet packages (3)
Showing the top 3 NuGet packages that depend on RCommon.Models:
| Package | Downloads |
|---|---|
|
RCommon.Core
A cohesive set of infrastructure libraries for dotnet that utilizes abstractions for event handling, persistence, unit of work, mediator, distributed messaging, event bus, CQRS, email, and more |
|
|
RCommon.ApplicationServices
A cohesive set of infrastructure libraries for dotnet that utilizes abstractions for event handling, persistence, unit of work, mediator, distributed messaging, event bus, CQRS, email, and more |
|
|
RCommon.BusinessServices
A lightweight application framework that utilizes abstractions over commonly used patterns to future proof applications. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 2.3.2-alpha.0.1 | 69 | 2/9/2026 |
| 2.3.1 | 484 | 2/5/2026 |
| 2.3.0 | 466 | 2/3/2026 |
| 2.2.2-alpha.0.1 | 376 | 12/11/2025 |
| 2.2.1-alpha.0.2 | 143 | 10/24/2025 |
| 2.2.1-alpha.0.1 | 150 | 10/24/2025 |
| 2.1.11-alpha.0.2 | 132 | 10/24/2025 |
| 2.1.11-alpha.0.1 | 98 | 7/18/2025 |
| 2.1.10 | 655 | 7/17/2025 |
| 2.1.9-alpha.0.1 | 141 | 7/17/2025 |
| 2.1.2.4 | 580 | 5/21/2025 |
| 2.1.2.3 | 575 | 5/1/2025 |
| 2.1.2.2 | 906 | 1/23/2025 |
| 2.1.2.1 | 688 | 1/17/2025 |
| 2.1.2 | 536 | 1/17/2025 |
| 2.1.1.4 | 263 | 1/7/2025 |
| 2.1.1.3 | 289 | 11/22/2024 |
| 2.1.1.2 | 254 | 11/22/2024 |
| 2.1.1.1 | 237 | 11/22/2024 |
| 0.0.0-alpha.0 | 149 | 7/17/2025 |