FluentValidation 10.3.5 Prefix Reserved

Install-Package FluentValidation -Version 10.3.5
dotnet add package FluentValidation --version 10.3.5
<PackageReference Include="FluentValidation" Version="10.3.5" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add FluentValidation --version 10.3.5
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: FluentValidation, 10.3.5"
#r directive can be used in F# Interactive, C# scripting and .NET Interactive. Copy this into the interactive tool or source code of the script to reference the package.
// Install FluentValidation as a Cake Addin
#addin nuget:?package=FluentValidation&version=10.3.5

// Install FluentValidation as a Cake Tool
#tool nuget:?package=FluentValidation&version=10.3.5
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

FluentValidation is validation library for .NET that uses a fluent interface and lambda expressions for building strongly-typed validation rules.

Supporting the project

If you use FluentValidation in a commercial project, please sponsor the project financially. FluentValidation is developed and supported by @JeremySkinner for free in his spare time and financial sponsorship helps keep the project going. You can sponsor the project via either GitHub sponsors or OpenCollective.

Example

With FluentValidation, you can define a class that inherits from AbstractValidator which contains the rules for a particular class. The example below shows how you could define rules for a Customer class, and then how to execute the validator.

using FluentValidation;

public class CustomerValidator: AbstractValidator<Customer> {
  public CustomerValidator() {
    RuleFor(x => x.Surname).NotEmpty();
    RuleFor(x => x.Forename).NotEmpty().WithMessage("Please specify a first name");
    RuleFor(x => x.Discount).NotEqual(0).When(x => x.HasDiscount);
    RuleFor(x => x.Address).Length(20, 250);
    RuleFor(x => x.Postcode).Must(BeAValidPostcode).WithMessage("Please specify a valid postcode");
  }

  private bool BeAValidPostcode(string postcode) {
    // custom postcode validating logic goes here
  }
}

var customer = new Customer();
var validator = new CustomerValidator();

// Execute the validator.
ValidationResult results = validator.Validate(customer);

// Inspect any validation failures.
bool success = results.IsValid;
List<ValidationFailure> failures = results.Errors;

Full Documentation

Full documentation can be found at https://docs.fluentvalidation.net

Release Notes and Change Log

Release notes can be found on GitHub.

  • .NETStandard 2.0

    • No dependencies.
  • .NETStandard 2.1

    • No dependencies.
  • net5.0

    • No dependencies.
  • net6.0

    • No dependencies.

NuGet packages (1.0K)

Showing the top 5 NuGet packages that depend on FluentValidation:

Package Downloads
FluentValidation.AspNetCore

AspNetCore integration for FluentValidation

FluentValidation.DependencyInjectionExtensions

Dependency injection extensions for FluentValidation

MicroElements.Swashbuckle.FluentValidation

Swagger ISchemaFilter that uses FluentValidation validators instead System.ComponentModel based attributes.

FluentValidation.WebAPI

ASP.NET WebApi integration for FluentValidation

Ocelot

Ocelot is an API Gateway. The project is aimed at people using .NET running a micro services / service orientated architecture that need a unified point of entry into their system. In particular I want easy integration with IdentityServer reference and bearer tokens. reference tokens. Ocelot is a bunch of middlewares in a specific order. Ocelot manipulates the HttpRequest object into a state specified by its configuration until it reaches a request builder middleware where it creates a HttpRequestMessage object which is used to make a request to a downstream service. The middleware that makes the request is the last thing in the Ocelot pipeline. It does not call the next middleware. The response from the downstream service is stored in a per request scoped repository and retrived as the requests goes back up the Ocelot pipeline. There is a piece of middleware that maps the HttpResponseMessage onto the HttpResponse object and that is returned to the client. That is basically it with a bunch of other features.

GitHub repositories (121)

Showing the top 5 popular GitHub repositories that depend on FluentValidation:

Repository Stars
aspnetboilerplate/aspnetboilerplate
ASP.NET Boilerplate - Web Application Framework
NancyFx/Nancy
Lightweight, low-ceremony, framework for building HTTP based services on .Net and Mono
abpframework/abp
Open Source Web Application Framework for ASP.NET Core
dotnet-architecture/eShopOnWeb
Sample ASP.NET Core 5.0 reference application, powered by Microsoft, demonstrating a layered application architecture with monolithic deployment model. Download the eBook PDF from docs folder.
Sonarr/Sonarr
Smart PVR for newsgroup and bittorrent users.
Version Downloads Last updated
10.3.5 0 11/30/2021
10.3.4 554,593 10/22/2021
10.3.3 1,926,929 8/24/2021
10.3.1 161,099 8/19/2021
10.3.0 1,769,904 7/9/2021
10.2.3 1,966,725 6/3/2021
10.2.2 156,163 6/1/2021
10.2.1 203,684 5/30/2021
10.2.0 66,477 5/28/2021
10.1.0 1,469,142 4/28/2021
10.0.4 848,946 4/17/2021
9.5.4 799,064 4/5/2021
9.5.3 1,534,614 3/15/2021
9.5.2 631,087 3/8/2021
9.5.1 2,262,429 2/11/2021
9.5.0 1,068,932 1/31/2021
9.4.0 1,251,414 1/14/2021
9.3.0 5,258,489 11/10/2020
9.3.0-preview3 19,818 10/19/2020
9.3.0-preview2 89,128 9/15/2020
9.3.0-preview1 7,906 8/26/2020
9.2.2 3,189,332 9/20/2020
9.2.1 10,809 9/19/2020
9.2.0 3,638,847 8/26/2020
9.1.3 572,179 8/19/2020
9.1.2 436,601 8/12/2020
9.1.1 305,261 8/8/2020
9.1.0 15,432 8/8/2020
9.0.1 1,989,733 7/14/2020
9.0.0-preview5 57,273 5/23/2020
9.0.0-preview4 74,205 4/22/2020
9.0.0-preview3 115,198 2/29/2020
9.0.0-preview2 26,006 2/21/2020
9.0.0-preview1 56,797 2/8/2020
8.6.3 1,130,623 8/28/2020
8.6.2 12,959,300 2/29/2020
8.6.1 6,471,750 12/28/2019
8.6.0 2,478,470 12/4/2019
8.5.1 2,157,988 11/2/2019
8.5.0 3,147,821 9/24/2019
8.5.0-preview5 50,961 9/1/2019
8.5.0-preview4 75,243 7/23/2019
8.5.0-preview3 26,538 7/10/2019
8.5.0-preview2 44,343 6/13/2019
8.5.0-preview1 45,546 5/10/2019
8.4.0 8,428,340 5/10/2019
8.3.0 1,857,248 4/24/2019
8.2.3 423,399 4/12/2019
8.2.2 631,607 4/5/2019
8.2.1 143,062 4/4/2019
8.2.0 655,323 3/26/2019
8.1.3 3,645,018 1/25/2019
8.1.2 1,532,905 12/18/2018
8.1.1 436,687 12/11/2018
8.1.0 368,834 12/6/2018
8.1.0-preview2 26,317 11/14/2018
8.1.0-preview1 25,465 10/14/2018
8.0.101 482,209 11/24/2018
8.0.100 2,644,043 9/4/2018
8.0.0 645,762 8/16/2018
8.0.0-rc1 40,655 7/24/2018
8.0.0-preview4 22,391 7/16/2018
8.0.0-preview3 21,110 7/13/2018
8.0.0-preview2 20,894 7/13/2018
7.6.105 824,341 8/11/2018
7.6.104 1,795,174 7/6/2018
7.6.103 850,683 6/16/2018
7.6.102 188,729 6/14/2018
7.6.101 63,725 6/13/2018
7.6.100 137,425 6/7/2018
7.6.0 270,822 6/1/2018
7.6.0-preview1 36,556 4/12/2018
7.5.2 2,292,876 3/16/2018
7.5.1 177,149 3/11/2018
7.5.0 583,631 2/26/2018
7.4.0 894,865 1/26/2018
7.3.4 750,387 1/2/2018
7.3.3 150,788 12/22/2017
7.3.2 48,894 12/21/2017
7.3.1 226,092 12/13/2017
7.3.0 37,158 12/13/2017
7.3.0-beta3 25,540 12/8/2017
7.3.0-beta2 39,256 11/20/2017
7.3.0-beta1 22,532 11/11/2017
7.2.1 1,790,007 10/24/2017
7.2.0 588,638 10/5/2017
7.2.0-beta3 38,320 9/5/2017
7.2.0-beta2 24,307 8/22/2017
7.2.0-beta1 20,971 8/19/2017
7.1.1 1,236,709 7/25/2017
7.1.0 358,122 6/28/2017
7.1.0-beta1 20,786 6/24/2017
7.0.3 524,491 6/7/2017
7.0.2 192,694 5/26/2017
7.0.1 59,037 5/23/2017
7.0.0 312,770 5/19/2017
7.0.0-beta3 24,845 5/1/2017
7.0.0-beta2 24,445 4/17/2017
7.0.0-beta1 21,963 4/7/2017
6.4.1 911,986 3/15/2017
6.4.1-beta1 21,696 3/13/2017
6.4.0 621,634 3/3/2017
6.4.0-rc4 143,120 2/13/2017
6.4.0-rc3 31,601 2/3/2017
6.4.0-rc2 37,039 1/30/2017
6.4.0-rc1 20,831 1/30/2017
6.4.0-beta9 82,678 11/21/2016
6.4.0-beta8 47,479 10/31/2016
6.4.0-beta7 21,388 10/28/2016
6.4.0-beta6 21,804 10/25/2016
6.4.0-beta5 21,494 10/24/2016
6.4.0-beta4 21,525 10/21/2016
6.4.0-beta3 65,866 7/4/2016
6.4.0-beta2 22,384 7/1/2016
6.4.0-beta10 20,679 1/30/2017
6.4.0-beta1 24,623 6/28/2016
6.3.4-alpha 268,938 6/1/2016
6.3.3-alpha 21,056 5/27/2016
6.2.1 2,873,585 2/26/2016
6.2.1-beta1 24,978 2/24/2016
6.2.0 100,467 2/22/2016
6.2.0-beta1 21,191 2/12/2016
6.1.0 278,903 1/18/2016
6.0.2 92,477 1/5/2016
6.0.1 33,791 1/5/2016
6.0.0 76,402 12/22/2015
5.6.2 943,137 5/29/2015
5.6.1 27,931 5/29/2015
5.5.0 746,500 10/31/2014
5.4.0 450,559 7/3/2014
5.3.0 81,550 5/27/2014
5.2.0 55,839 5/21/2014
5.1.0 488,926 3/11/2014
5.0.0.1 255,785 10/24/2013
4.0.0.1 189,930 7/18/2013
4.0.0 92,084 4/29/2013
3.4.6 270,022 8/30/2012
3.4.0 54,387 8/17/2012
3.3.1 45,768 3/30/2012
3.2.0 57,180 11/14/2011
3.1.0 48,199 7/30/2011
3.0.0.1 23,346 7/5/2011
3.0.0 30,363 6/25/2011
2.0.0 45,610 1/9/2011
1.3.0 67,820 1/7/2011

FluentValidation 10 is a major release. Please read the upgrade guide at https://docs.fluentvalidation.net/en/latest/upgrading-to-10.html

Full release notes can be found at https://github.com/FluentValidation/FluentValidation/releases