Osirion.Blazor.Cms.Application 2.1.5

dotnet add package Osirion.Blazor.Cms.Application --version 2.1.5
                    
NuGet\Install-Package Osirion.Blazor.Cms.Application -Version 2.1.5
                    
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="2.1.5" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Osirion.Blazor.Cms.Application" Version="2.1.5" />
                    
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 2.1.5
                    
#r "nuget: Osirion.Blazor.Cms.Application, 2.1.5"
                    
#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@2.1.5
                    
#: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=2.1.5
                    
Install as a Cake Addin
#tool nuget:?package=Osirion.Blazor.Cms.Application&version=2.1.5
                    
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 contains application services, DTOs, validators, mappers, and command/query handlers.

Components

Application Services

Services that orchestrate the application logic:

public class ContentApplicationService : IContentApplicationService
{
    private readonly IContentRepository _repository;
    private readonly IMarkdownProcessor _markdownProcessor;
    private readonly ILogger<ContentApplicationService> _logger;

    public ContentApplicationService(
        IContentRepository repository, 
        IMarkdownProcessor markdownProcessor,
        ILogger<ContentApplicationService> logger)
    {
        _repository = repository;
        _markdownProcessor = markdownProcessor;
        _logger = logger;
    }

    public async Task<ContentDto> GetContentByPathAsync(string path)
    {
        var content = await _repository.GetByPathAsync(path);
        if (content is null)
        {
            _logger.LogWarning("Content not found for path: {Path}", path);
            throw new ContentNotFoundException(path);
        }

        var processedContent = await _markdownProcessor.ProcessAsync(content.Content);
        return MapToDto(content, processedContent);
    }

    // Additional methods
}

DTOs (Data Transfer Objects)

Objects used to transfer data between the application and presentation layers:

public class ContentDto
{
    public string Path { get; set; } = string.Empty;
    public string Title { get; set; } = string.Empty;
    public string ProcessedContent { get; set; } = string.Empty;
    public string RawContent { get; set; } = string.Empty;
    public Dictionary<string, object> Metadata { get; set; } = new();
    public DateTime? PublishedDate { get; set; }
    public string? Author { get; set; }
    public List<string> Tags { get; set; } = new();
    public List<string> Categories { get; set; } = new();
    public bool IsFeatured { get; set; }
    public string? FeaturedImage { get; set; }
}

Validators

Input validation using FluentValidation:

public class ContentQueryValidator : AbstractValidator<ContentQueryDto>
{
    public ContentQueryValidator()
    {
        RuleFor(x => x.Path)
            .NotEmpty()
            .When(x => x.Directory is null && x.Tag is null && x.Category is null);
        
        RuleFor(x => x.Skip)
            .GreaterThanOrEqualTo(0);
        
        RuleFor(x => x.Count)
            .GreaterThanOrEqualTo(1)
            .When(x => x.Count.HasValue);
    }
}

Key Features

Markdown Processing

Advanced markdown processing with support for:

  • Front matter extraction and parsing
  • Syntax highlighting
  • Table rendering
  • Task lists
  • Automatic linking
  • Diagrams and charts
  • Custom extensions

Content Caching

Efficient content handling with caching:

public async Task<ContentDto> GetContentByPathAsync(string path)
{
    var cacheKey = $"content:{path}";
    
    if (_cache.TryGetValue(cacheKey, out ContentDto? cachedContent))
        return cachedContent!;
        
    var content = await _repository.GetByPathAsync(path);
    // Process and map content
    
    var options = new MemoryCacheEntryOptions()
        .SetSlidingExpiration(TimeSpan.FromMinutes(30))
        .SetAbsoluteExpiration(TimeSpan.FromHours(2));
        
    _cache.Set(cacheKey, result, options);
    
    return result;
}

Dependencies

The application layer has the following dependencies:

  • Osirion.Blazor.Cms.Domain: For domain entities and interfaces
  • FluentValidation: For input validation
  • Markdig: For Markdown processing

License

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

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 was computed.  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.Core

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

Osirion.Blazor.Cms.Infrastructure

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

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
2.1.5 180 6/24/2025
2.1.4 180 6/18/2025
2.1.3 101 5/31/2025
2.1.2 77 5/31/2025
2.1.0 233 5/20/2025