BluQube 1.0.0

dotnet add package BluQube --version 1.0.0
                    
NuGet\Install-Package BluQube -Version 1.0.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="BluQube" Version="1.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="BluQube" Version="1.0.0" />
                    
Directory.Packages.props
<PackageReference Include="BluQube" />
                    
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 BluQube --version 1.0.0
                    
#r "nuget: BluQube, 1.0.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.
#addin nuget:?package=BluQube&version=1.0.0
                    
Install as a Cake Addin
#tool nuget:?package=BluQube&version=1.0.0
                    
Install as a Cake Tool

BluQube

BluQube is a framework for Blazor to help with the write once, run on Server or WASM approach.

Overview

BluQube provides a unified development experience for Blazor applications, allowing you to write your application logic once and deploy it to both Blazor Server and Blazor WebAssembly without modification. The framework includes command and query handling patterns with built-in validation and error handling.

Features

  • Unified Blazor Development: Write once, run on both Server and WASM
  • Command & Query Pattern: Built-in CQRS-style architecture
  • Validation Support: Integrated validation with detailed error reporting
  • Source Generation: Automated code generation for improved performance
  • Error Handling: Comprehensive error handling with structured error data

Quick Start

Installation

Install the BluQube package via NuGet:

dotnet add package BluQube

Basic Usage

Server side
// Handle the command
public class MyCommandHandler(IEnumerable<IValidator<MyCommandCommand>> validators, ILogger<MyCommandCommandHandler> logger)
    : ICommandHandler<MyCommand>(validators, logger)
{
    protected override Task<CommandResult> HandleInternal(AddTodoCommand request, CancellationToken cancellationToken)
    {
        // Your business logic here
        return Task.FromResult(CommandResult.Success());
    }
}

// Process the query
public class MyQueryProcessor() : IQueryProcessor<MyQuery, MyQueryResult>
{
    public Task<QueryResult<GMyQueryResult>> Handle(MyQuery request, CancellationToken cancellationToken)
    {
         return Task.FromResult(QueryResult<MyQueryResult>.Succeeded(new MyQueryResult()));
    }
}
Client side
// Define a command
[BluQubeCommand(Path = "commands/mycommand")]
public record MyCommand(string Name) : ICommand;

[BluQubeQuery(Path = "queries/myquery")]
public record MyQuery(string Name) : IQuery<MyQueryResult>;

public record MyQueryResult(string Info) : IQueryResult;

Core Concepts

Commands

Commands represent actions that modify application state. They return CommandResult objects that can indicate success, failure, or validation errors.

Queries

Queries retrieve data without modifying state, following the CQRS pattern.

Error Handling

BluQube provides structured error handling with BluQubeErrorData containing error codes and messages.

Validation

BluQube integrates validation using FluentValidation, allowing you to define validation rules for commands and queries.

Authorization

BluQube supports authorization checks for commands, ensuring that only authorized users can perform certain actions. This is performed using the Mediatr behavior MediatR.Behaviors.Authorization.

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Add tests for new functionality
  5. Ensure all tests pass
  6. Submit a pull request

License

This project is licensed under the terms specified in the LICENSE file.

Support

For questions, issues, or contributions, please visit the GitHub repository.

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 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

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.0 92 6/20/2025