Osirion.Blazor.Cms.Application 4.1.0

Prefix Reserved
There is a newer version of this package available.
See the version list below for details.
dotnet add package Osirion.Blazor.Cms.Application --version 4.1.0
                    
NuGet\Install-Package Osirion.Blazor.Cms.Application -Version 4.1.0
                    
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="Osirion.Blazor.Cms.Application" Version="4.1.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Osirion.Blazor.Cms.Application" Version="4.1.0" />
                    
Directory.Packages.props
<PackageReference Include="Osirion.Blazor.Cms.Application" />
                    
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 Osirion.Blazor.Cms.Application --version 4.1.0
                    
#r "nuget: Osirion.Blazor.Cms.Application, 4.1.0"
                    
#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 Osirion.Blazor.Cms.Application@4.1.0
                    
#: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=Osirion.Blazor.Cms.Application&version=4.1.0
                    
Install as a Cake Addin
#tool nuget:?package=Osirion.Blazor.Cms.Application&version=4.1.0
                    
Install as a Cake Tool

Osirion.Blazor.Cms.Application

NuGet License

Application layer for the Osirion.Blazor CMS ecosystem, implementing core business logic, use cases, and application services.

Overview

The Application project represents the application layer in the Clean Architecture pattern, bridging the domain models with the infrastructure and presentation layers. It uses a command/query split: commands and queries are plain classes, each handled by one handler, and two dispatchers resolve the handler from the service provider. This package ships handlers for the content commands, for GetContentByIdQuery, GetContentByPathQuery, SearchContentQuery, GetDirectoryByPathQuery and GetDirectoryTreeQuery; the other commands and queries need a handler registered by the host. Input is validated with FluentValidation before a command runs.

Components

Commands

A command implements ICommand and is handled by an ICommandHandler<TCommand> (namespace Osirion.Blazor.Cms.Application.Commands):

public interface ICommandHandler<in TCommand> where TCommand : ICommand
{
    Task HandleAsync(TCommand command, CancellationToken cancellationToken = default);
}

Content commands (Osirion.Blazor.Cms.Application.Commands.Content) are CreateContentCommand, UpdateContentCommand and DeleteContentCommand. Directory commands (Osirion.Blazor.Cms.Application.Commands.Directory) are CreateDirectoryCommand, UpdateDirectoryCommand, MoveDirectoryCommand and DeleteDirectoryCommand.

await commandDispatcher.DispatchAsync(new CreateContentCommand
{
    Title = "Hello",
    Content = "# Hello",
    Path = "blog/hello.md",
    CommitMessage = "Add hello post"
});

ICommandDispatcher.DispatchAsync<TCommand>(command, cancellationToken) is implemented by ValidatingCommandDispatcher. It runs the registered validator, if there is one, and throws ContentValidationException when validation fails.

Queries

A query implements IQuery<TResult> and is handled by an IQueryHandler<TQuery, TResult> (namespace Osirion.Blazor.Cms.Application.Queries):

public interface IQueryHandler<in TQuery, TResult> where TQuery : IQuery<TResult>
{
    Task<TResult> HandleAsync(TQuery query, CancellationToken cancellationToken = default);
}

Content queries (Osirion.Blazor.Cms.Application.Queries.Content) include GetContentByPathQuery, GetContentByIdQuery, GetContentByUrlQuery, GetAllContentQuery, SearchContentQuery, GetContentCategoriesQuery and GetContentTagsQuery. Directory queries (Osirion.Blazor.Cms.Application.Queries.Directory) are GetDirectoryByIdQuery, GetDirectoryByPathQuery and GetDirectoryTreeQuery.

var item = await queryDispatcher.DispatchAsync<GetContentByPathQuery, ContentItem?>(
    new GetContentByPathQuery { Path = "blog/hello.md" });

Validators

Input validation uses FluentValidation. CreateContentCommandValidator and UpdateContentCommandValidator (namespace Osirion.Blazor.Cms.Application.Validation.Content) are AbstractValidator<T> classes, for example:

public class CreateContentCommandValidator : AbstractValidator<CreateContentCommand>
{
    public CreateContentCommandValidator()
    {
        RuleFor(x => x.Title)
            .NotEmpty().WithMessage("Title is required")
            .MaximumLength(200).WithMessage("Title cannot exceed 200 characters");

        // Further rules for Content, Path and Slug
    }
}

FluentValidationAdapter<T> exposes a FluentValidation validator through the application's own IValidator<T>.

Registration

This package does not register its services. AddOsirionCqrs() in the Osirion.Blazor.Cms.Infrastructure package (namespace Osirion.Blazor.Cms.Infrastructure.DependencyInjection) registers the dispatchers, the command and query handlers, the validators and their adapters.

Dependencies

The application layer has the following dependencies:

  • Osirion.Blazor.Cms.Domain: For domain entities and interfaces
  • FluentValidation: For input validation
  • Microsoft.Extensions.DependencyInjection and Microsoft.Extensions.Logging.Abstractions: For service resolution and logging

License

This project is licensed under the MIT License - see the LICENSE file for details.

Product Compatible and additional computed target framework versions.
.NET 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.

NuGet packages (2)

Showing the top 2 NuGet packages that depend on Osirion.Blazor.Cms.Application:

Package Downloads
Osirion.Blazor.Cms.Infrastructure

Infrastructure layer for the Osirion.Blazor CMS ecosystem, implementing repositories, external service integrations, and infrastructure concerns.

Osirion.Blazor.Cms.Core

Core CMS module for Osirion.Blazor - Provides cms management with provider pattern.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
4.2.0 240 10/18/2026
4.1.0 243 10/17/2026
4.0.0 160 10/12/2026
3.0.1 273 9/24/2026
3.0.0 222 8/5/2026
2.1.18 336 12/14/2025
2.1.17 299 12/14/2025
2.1.16 320 12/14/2025
2.1.15 290 12/12/2025
2.1.14 568 12/11/2025
2.1.13 577 12/11/2025
2.1.12 367 9/4/2025
2.1.11 325 8/31/2025
2.1.10 370 8/29/2025
2.1.9 381 8/29/2025
2.1.8 381 8/27/2025
2.1.7 481 8/25/2025
2.1.6 275 8/23/2025
2.1.5 342 6/24/2025
2.1.4 346 6/18/2025
Loading failed