JAAvila.FluentOperations.AspNetCore 1.5.0

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

JAAvila.FluentOperations.AspNetCore

ASP.NET Core integration for JAAvila.FluentOperations Quality Blueprints. Provides action filters that automatically validate request models before they reach your controllers.

Installation

dotnet add package JAAvila.FluentOperations.AspNetCore

Quick Start

1. Register services

var builder = WebApplication.CreateBuilder(args);

// Option A: Register filter + add to MVC pipeline in one call
builder.Services.AddControllers()
    .AddBlueprintValidation();

// Option B: Register individually
builder.Services.AddBlueprintValidationFilter();
builder.Services.AddControllers(options =>
{
    options.AddBlueprintValidation();
});

2. Define a Blueprint

public class CreateOrderBlueprint : QualityBlueprint<CreateOrderRequest>
{
    public CreateOrderBlueprint()
    {
        For(x => x.CustomerName).NotBeNullOrWhiteSpace().HaveMinLength(2);
        For(x => x.Quantity).BePositive().BeLessThan(1000);
    }
}

Register it in DI:

builder.Services.AddSingleton<QualityBlueprint<CreateOrderRequest>, CreateOrderBlueprint>();

3. Apply validation

Global (all controllers) — already done if you used AddBlueprintValidation() above.

Per controller or action using the attribute:

[ValidateWithBlueprint]
[ApiController]
[Route("api/[controller]")]
public class OrdersController : ControllerBase
{
    [HttpPost]
    public IActionResult Create(CreateOrderRequest request) => Ok();
}

Strongly typed filter for a specific model:

builder.Services.AddBlueprintFilter<CreateOrderRequest, CreateOrderBlueprint>();

Validation Response

When validation fails, the filter returns a 400 Bad Request with:

{
  "title": "Validation Failed",
  "status": 400,
  "errors": [
    {
      "property": "CustomerName",
      "message": "The value was expected to not be null or whitespace.",
      "attemptedValue": ""
    }
  ],
  "rulesEvaluated": 2
}

Features

  • Automatic discovery: resolves QualityBlueprint<T> from DI for each action parameter, walking the type hierarchy to support base-class blueprints.
  • Global or selective: apply validation globally via MVC options, or per-controller/action with [ValidateWithBlueprint].
  • Strongly typed filter: BlueprintValidationFilter<TModel, TBlueprint> for compile-time safety when targeting a specific model.

Requirements

Dependency Version
.NET 8.0+
JAAvila.FluentOperations (same major version)
Microsoft.AspNetCore.Mvc.Core 2.2.5+

License

Apache-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 was computed.  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.5.0 93 3/29/2026
1.3.0 85 3/26/2026
1.1.0 92 3/21/2026
1.0.1 87 3/9/2026
1.0.0 93 3/8/2026