SharpGrip.FluentValidation.AutoValidation.Endpoints
1.0.0-beta2
Prefix Reserved
See the version list below for details.
dotnet add package SharpGrip.FluentValidation.AutoValidation.Endpoints --version 1.0.0-beta2
NuGet\Install-Package SharpGrip.FluentValidation.AutoValidation.Endpoints -Version 1.0.0-beta2
<PackageReference Include="SharpGrip.FluentValidation.AutoValidation.Endpoints" Version="1.0.0-beta2" />
paket add SharpGrip.FluentValidation.AutoValidation.Endpoints --version 1.0.0-beta2
#r "nuget: SharpGrip.FluentValidation.AutoValidation.Endpoints, 1.0.0-beta2"
// Install SharpGrip.FluentValidation.AutoValidation.Endpoints as a Cake Addin #addin nuget:?package=SharpGrip.FluentValidation.AutoValidation.Endpoints&version=1.0.0-beta2&prerelease // Install SharpGrip.FluentValidation.AutoValidation.Endpoints as a Cake Tool #tool nuget:?package=SharpGrip.FluentValidation.AutoValidation.Endpoints&version=1.0.0-beta2&prerelease
SharpGrip FluentValidation AutoValidation
Builds
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 | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | 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. |
-
net7.0
- SharpGrip.FluentValidation.AutoValidation.Shared (>= 1.0.0-beta2)
NuGet packages (4)
Showing the top 4 NuGet packages that depend on SharpGrip.FluentValidation.AutoValidation.Endpoints:
Package | Downloads |
---|---|
Fluxera.Extensions.Hosting.Modules.AspNetCore.HttpApi
A module that enables HTTP APIs for ASP.NET Core. |
|
GlavLib.App
Package Description |
|
Senlin.Mo
Modular monolith |
|
Pivotte
A tool to help you declare API endpoints for both clients and servers. |
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
1.4.0 | 113,541 | 12/17/2023 |
1.3.1 | 9,070 | 10/19/2023 |
1.3.0 | 3,809 | 10/9/2023 |
1.2.0 | 947 | 9/22/2023 |
1.1.0 | 608 | 9/6/2023 |
1.0.1 | 224 | 8/21/2023 |
1.0.0 | 425 | 8/19/2023 |
1.0.0-beta3 | 123 | 8/17/2023 |
1.0.0-beta2 | 138 | 8/16/2023 |
1.0.0-beta1 | 133 | 8/16/2023 |