RCommon.Models 2.3.2-alpha.0.1

This is a prerelease version of RCommon.Models.
dotnet add package RCommon.Models --version 2.3.2-alpha.0.1
                    
NuGet\Install-Package RCommon.Models -Version 2.3.2-alpha.0.1
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="RCommon.Models" Version="2.3.2-alpha.0.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="RCommon.Models" Version="2.3.2-alpha.0.1" />
                    
Directory.Packages.props
<PackageReference Include="RCommon.Models" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add RCommon.Models --version 2.3.2-alpha.0.1
                    
#r "nuget: RCommon.Models, 2.3.2-alpha.0.1"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package RCommon.Models@2.3.2-alpha.0.1
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=RCommon.Models&version=2.3.2-alpha.0.1&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=RCommon.Models&version=2.3.2-alpha.0.1&prerelease
                    
Install as a Cake Tool

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

  • ICommand and ICommand<TResult> marker interfaces for CQRS command segregation
  • IQuery and IQuery<TResult> marker interfaces for CQRS query segregation
  • ISerializableEvent, ISyncEvent, and IAsyncEvent marker interfaces for controlling event dispatch behavior
  • CommandResult<TExecutionResult> record for wrapping command handler outcomes
  • ExecutionResult with static factory methods for Success() and Failed(errors) using cached singletons
  • PaginatedListModel<TSource> and PaginatedListModel<TSource, TOut> abstract records for building paginated DTOs with built-in page calculation
  • PaginatedListRequest and SearchPaginatedListRequest for encapsulating paging, sorting, and search parameters
  • SortDirectionEnum for specifying ascending, descending, or no-sort ordering
  • All models are decorated with DataContract/DataMember attributes 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.

  • 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 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • 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
Loading failed