SharpGrip.FluentValidation.AutoValidation.Mvc 1.0.0-beta1

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

SharpGrip FluentValidation AutoValidation

Builds

FluentValidation.AutoValidation [Build]

Quality Gate Status
Maintainability Rating
Reliability Rating
Security Rating
Coverage

Introduction

SharpGrip FluentValidation AutoValidation is an extension of the FluentValidation library enabling automatic asynchronous validation in MVC controllers and minimal APIs (endpoints). The library FluentValidation.AspNetCore is no longer being maintained and is unsupported. As a result, support for automatic validation provided by this library is no longer available. This library re-introduces this functionality for MVC controllers and introduces automation validation for minimal APIs (endpoints). It enables developers to easily implement automatic validation in their projects.

Installation

Register your validators with the Microsoft DI service container, for reference please see https://docs.fluentvalidation.net/en/latest/di.html.

MVC controllers

For MVC controllers reference NuGet package SharpGrip.FluentValidation.AutoValidation.Mvc (https://www.nuget.org/packages/SharpGrip.FluentValidation.AutoValidation.Mvc).

Minimal APIs

For minimal APIs (endpoints) reference NuGet package SharpGrip.FluentValidation.AutoValidation.Endpoints (https://www.nuget.org/packages/SharpGrip.FluentValidation.AutoValidation.Endpoints).

Usage

MVC controllers

using SharpGrip.FluentValidation.AutoValidation.Mvc.Extensions;

builder.Services.AddFluentValidationAutoValidation();

Minimal APIs (endpoints)

Enabling minimal API (endpoint) automatic validation can be done on both route groups and routes.

using SharpGrip.FluentValidation.AutoValidation.Endpoints.Extensions;

var endpointGroup = app.MapGroup("/some-group").AddFluentValidationAutoValidation();
endpointGroup.MapPost("/", (TestCreateModel testCreateModel) => $"Hello {testCreateModel.Name}");

app.MapPost("/", (TestCreateModel testCreateModel) => $"Hello again {testCreateModel.Name}").AddFluentValidationAutoValidation();
Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 is compatible.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  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. 
.NET Core netcoreapp3.1 is compatible. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (7)

Showing the top 5 NuGet packages that depend on SharpGrip.FluentValidation.AutoValidation.Mvc:

Package Downloads
Fluxera.Extensions.Hosting.Modules.AspNetCore.HttpApi

A module that enables HTTP APIs for ASP.NET Core.

ES.FX.Ignite.FluentValidation

Package Description

DDD.HTTP

易用、强大、高效且面向 HTTP 和领域驱动的一站式企业级开发基础设施,支持 AspnetCore WebAPI(MVC)/MiniAPI,提供 API 文档、API 多版本管理、跨域(CORS)、异常中间件、标准化 API 结果返回、API Key 授权、JWT等能力。

IFNK.ApiHelper

net core api 帮助类 Release Notes: 1.0.3 修改自动验证 Release Notes: 1.0.7 修改自动验证 1.0.9 log 级别 1.0.10 堆栈 更详细 1.0.11 添加日志功能 1.0.12 修改日志功能

ClearFlow.FluentValidation.Mvc

FluentValidation support for commands

GitHub repositories (2)

Showing the top 2 popular GitHub repositories that depend on SharpGrip.FluentValidation.AutoValidation.Mvc:

Repository Stars
TanvirArjel/CleanArchitecture
This repository contains the implementation of domain-driven design and clear architecture in ASP.NET Core.
pkuehnel/TeslaSolarCharger
A software to let your Tesla charge with solar energy ☀
Version Downloads Last updated
1.5.0 238,364 1/14/2025
1.4.0 1,129,963 12/17/2023
1.3.1 182,393 10/19/2023
1.3.0 61,623 10/9/2023
1.2.0 41,882 9/22/2023
1.1.0 33,052 9/6/2023
1.0.1 9,203 8/21/2023
1.0.0 6,351 8/19/2023
1.0.0-beta3 126 8/17/2023
1.0.0-beta2 137 8/16/2023
1.0.0-beta1 3,496 8/16/2023