HeroKit.FluentValidation
3.3.0
See the version list below for details.
dotnet add package HeroKit.FluentValidation --version 3.3.0
NuGet\Install-Package HeroKit.FluentValidation -Version 3.3.0
<PackageReference Include="HeroKit.FluentValidation" Version="3.3.0" />
<PackageVersion Include="HeroKit.FluentValidation" Version="3.3.0" />
<PackageReference Include="HeroKit.FluentValidation" />
paket add HeroKit.FluentValidation --version 3.3.0
#r "nuget: HeroKit.FluentValidation, 3.3.0"
#:package HeroKit.FluentValidation@3.3.0
#addin nuget:?package=HeroKit.FluentValidation&version=3.3.0
#tool nuget:?package=HeroKit.FluentValidation&version=3.3.0
HeroKit.FluentValidation
FluentValidation rules for HeroKit: Turkish identity and tax numbers, IBAN, card numbers, e-invoice numbers, MERSİS, barcodes, and phone numbers, postal codes, vehicle plates, national and tax ids of any registered country (Türkiye and the United States are built in).
dotnet add package HeroKit.FluentValidation
using FluentValidation;
using HeroKit.FluentValidation;
using HeroKit.Globalization;
public sealed class CustomerValidator : AbstractValidator<Customer>
{
public CustomerValidator()
{
RuleFor(x => x.IdentityNumber).NotEmpty().Tckn();
RuleFor(x => x.TaxId).TaxId(Countries.Turkey);
RuleFor(x => x.Iban).Iban();
RuleFor(x => x.Mobile).PhoneNumber(Countries.Turkey, mobileOnly: true);
RuleFor(x => x.PostalCode).PostalCode(Countries.Turkey);
RuleFor(x => x.Plate).VehiclePlate(Countries.Turkey);
RuleFor(x => x.Card).CardNumber();
RuleFor(x => x.InvoiceNumber).GibInvoiceNumber();
RuleFor(x => x.Mersis).Mersis();
}
}
Null and empty values pass; add NotEmpty() to require a value. Messages use {PropertyName} and can be replaced with WithMessage.
Documentation: https://herokit.emreakdemir.dev/articles/validation.html
| Product | Versions 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 is compatible. 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. |
-
net10.0
- FluentValidation (>= 12.0.0)
- HeroKit (>= 3.3.0)
-
net8.0
- FluentValidation (>= 12.0.0)
- HeroKit (>= 3.3.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Package readme updated for the 3.x country rules. Rules: Tckn, Vkn, Iban, CardNumber, GibInvoiceNumber, Ettn, Mersis, Gtin, PhoneNumber, VehiclePlate, PostalCode, NationalId, TaxId.