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](https://github.com/JeremySkinner)
for free in his spare time and financial sponsorship helps keep the project going.
You can sponsor the project via either [GitHub sponsors](https://github.com/sponsors/JeremySkinner) or [OpenCollective](https://opencollective.com/FluentValidation).
### 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.
```c#
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](https://docs.fluentvalidation.net)
### Release Notes and Change Log
Release notes [can be found on GitHub](https://github.com/FluentValidation/FluentValidation/releases).
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
收起资源包目录
软设课程设计:C#、WPF桌面应用-教材管理(附源码解决方案) (643个子文件)
_._ 0B
_._ 0B
_._ 0B
_._ 0B
_._ 0B
_._ 0B
_._ 0B
_._ 0B
_._ 0B
_._ 0B
_._ 0B
_._ 0B
_._ 0B
_._ 0B
ShellView.baml 6KB
FormBookView.baml 3KB
ModifyBookView.baml 2KB
Dictionary1.baml 1KB
App.baml 1KB
Demo.Textbook.WpfApp.csproj.AssemblyReference.cache 17KB
WpfApp3.csproj.AssemblyReference.cache 9KB
Demo.Textbook.RepositoryLiteDb.csproj.AssemblyReference.cache 6KB
DesignTimeResolveAssemblyReferences.cache 6KB
DesignTimeResolveAssemblyReferencesInput.cache 5KB
Demo.Textbook.Domain.csproj.AssemblyReference.cache 4KB
Demo.Textbook.WpfApp.csproj.Fody.CopyLocal.cache 3KB
DesignTimeResolveAssemblyReferencesInput.cache 3KB
DesignTimeResolveAssemblyReferencesInput.cache 2KB
Demo.Textbook.WpfApp_MarkupCompile.cache 565B
Demo.Textbook.WpfApp_MarkupCompile.i.cache 344B
WpfApp3_MarkupCompile.cache 268B
WpfApp3_MarkupCompile.i.cache 262B
WpfApp3.csproj.Fody.CopyLocal.cache 118B
Demo.Textbook.WpfApp.csproj.GenerateResource.cache 84B
WpfApp3.csproj.GenerateResource.cache 84B
Demo.Textbook.WpfApp.csproj.CoreCompileInputs.cache 66B
WpfApp3.csproj.CoreCompileInputs.cache 66B
Demo.Textbook.RepositoryLiteDb.csproj.CoreCompileInputs.cache 66B
Demo.Textbook.Domain.csproj.CoreCompileInputs.cache 66B
Demo.Textbook.WpfApp_hdtklokz_wpftmp.csproj.Fody.RuntimeCopyLocal.cache 0B
Demo.Textbook.WpfApp_rtfun305_wpftmp.csproj.Fody.CopyLocal.cache 0B
Demo.Textbook.WpfApp_jcoi4lx0_wpftmp.csproj.Fody.RuntimeCopyLocal.cache 0B
Demo.Textbook.WpfApp_ng55k1cj_wpftmp.csproj.Fody.RuntimeCopyLocal.cache 0B
Demo.Textbook.WpfApp_kz3p4qyr_wpftmp.csproj.Fody.RuntimeCopyLocal.cache 0B
Demo.Textbook.WpfApp_ewpn3pn2_wpftmp.csproj.Fody.RuntimeCopyLocal.cache 0B
Demo.Textbook.WpfApp_z4mjxtfz_wpftmp.csproj.Fody.CopyLocal.cache 0B
Demo.Textbook.WpfApp_kp1dz5az_wpftmp.csproj.Fody.RuntimeCopyLocal.cache 0B
Demo.Textbook.WpfApp_m0jaob55_wpftmp.csproj.Fody.RuntimeCopyLocal.cache 0B
Demo.Textbook.WpfApp_shsslstk_wpftmp.csproj.Fody.CopyLocal.cache 0B
WpfApp3_qv5u2cbq_wpftmp.csproj.Fody.RuntimeCopyLocal.cache 0B
Demo.Textbook.WpfApp_kzmx5luf_wpftmp.csproj.Fody.CopyLocal.cache 0B
Demo.Textbook.WpfApp_1htmbqkr_wpftmp.csproj.Fody.CopyLocal.cache 0B
WpfApp3_lcnumcf3_wpftmp.csproj.Fody.RuntimeCopyLocal.cache 0B
Demo.Textbook.WpfApp_uye3trti_wpftmp.csproj.Fody.CopyLocal.cache 0B
Demo.Textbook.WpfApp_aeoysknj_wpftmp.csproj.Fody.CopyLocal.cache 0B
Demo.Textbook.WpfApp_dgponjn0_wpftmp.csproj.Fody.CopyLocal.cache 0B
Demo.Textbook.WpfApp_djyirueo_wpftmp.csproj.Fody.CopyLocal.cache 0B
Demo.Textbook.WpfApp_wgzvcfrg_wpftmp.csproj.Fody.CopyLocal.cache 0B
Demo.Textbook.WpfApp_4tkcz0lo_wpftmp.csproj.Fody.CopyLocal.cache 0B
Demo.Textbook.WpfApp_im355q2x_wpftmp.csproj.Fody.RuntimeCopyLocal.cache 0B
WpfApp3_dwzaxe2c_wpftmp.csproj.Fody.RuntimeCopyLocal.cache 0B
WpfApp3_5l5d0wqa_wpftmp.csproj.Fody.CopyLocal.cache 0B
Demo.Textbook.WpfApp_m0jaob55_wpftmp.csproj.Fody.CopyLocal.cache 0B
Demo.Textbook.WpfApp_oyimaozw_wpftmp.csproj.Fody.CopyLocal.cache 0B
Demo.Textbook.WpfApp_ulkmtiyv_wpftmp.csproj.Fody.CopyLocal.cache 0B
WpfApp3_mfy1n2nv_wpftmp.csproj.Fody.RuntimeCopyLocal.cache 0B
Demo.Textbook.WpfApp_jcoi4lx0_wpftmp.csproj.Fody.CopyLocal.cache 0B
Demo.Textbook.WpfApp_4im3gdjj_wpftmp.csproj.Fody.CopyLocal.cache 0B
Demo.Textbook.WpfApp_5rkc15bk_wpftmp.csproj.Fody.RuntimeCopyLocal.cache 0B
Demo.Textbook.WpfApp_inmvfjg1_wpftmp.csproj.Fody.CopyLocal.cache 0B
WpfApp3_n5jvjq04_wpftmp.csproj.Fody.CopyLocal.cache 0B
Demo.Textbook.WpfApp_gncrlydy_wpftmp.csproj.Fody.RuntimeCopyLocal.cache 0B
Demo.Textbook.WpfApp_qrkfptku_wpftmp.csproj.Fody.CopyLocal.cache 0B
WpfApp3_4qetb2js_wpftmp.csproj.Fody.CopyLocal.cache 0B
Demo.Textbook.WpfApp_djyirueo_wpftmp.csproj.Fody.RuntimeCopyLocal.cache 0B
Demo.Textbook.WpfApp_krfkhuld_wpftmp.csproj.Fody.RuntimeCopyLocal.cache 0B
Demo.Textbook.WpfApp_x5dvxyzu_wpftmp.csproj.Fody.CopyLocal.cache 0B
Demo.Textbook.WpfApp_ozcetpm3_wpftmp.csproj.Fody.RuntimeCopyLocal.cache 0B
WpfApp3_zmo3xxdg_wpftmp.csproj.Fody.RuntimeCopyLocal.cache 0B
WpfApp3_n5jvjq04_wpftmp.csproj.Fody.RuntimeCopyLocal.cache 0B
Demo.Textbook.WpfApp_pmgrfwwr_wpftmp.csproj.Fody.RuntimeCopyLocal.cache 0B
Demo.Textbook.WpfApp_vhwn1yry_wpftmp.csproj.Fody.CopyLocal.cache 0B
Demo.Textbook.WpfApp_gncrlydy_wpftmp.csproj.Fody.CopyLocal.cache 0B
Demo.Textbook.WpfApp_wgzvcfrg_wpftmp.csproj.Fody.RuntimeCopyLocal.cache 0B
Demo.Textbook.WpfApp_a2a1ulfw_wpftmp.csproj.Fody.RuntimeCopyLocal.cache 0B
WpfApp3_y4dk4u1k_wpftmp.csproj.Fody.CopyLocal.cache 0B
Demo.Textbook.WpfApp_vob0fvrr_wpftmp.csproj.Fody.CopyLocal.cache 0B
WpfApp3_mfy1n2nv_wpftmp.csproj.Fody.CopyLocal.cache 0B
Demo.Textbook.WpfApp_owuelp3t_wpftmp.csproj.Fody.CopyLocal.cache 0B
Demo.Textbook.WpfApp_u0mqea4c_wpftmp.csproj.Fody.CopyLocal.cache 0B
Demo.Textbook.WpfApp_ekqzbmst_wpftmp.csproj.Fody.RuntimeCopyLocal.cache 0B
WpfApp3_e2zssuac_wpftmp.csproj.Fody.RuntimeCopyLocal.cache 0B
Demo.Textbook.WpfApp_2ni2grls_wpftmp.csproj.Fody.RuntimeCopyLocal.cache 0B
Demo.Textbook.WpfApp_3mix4xan_wpftmp.csproj.Fody.RuntimeCopyLocal.cache 0B
WpfApp3_4br02veh_wpftmp.csproj.Fody.CopyLocal.cache 0B
WpfApp3_gw13dqsr_wpftmp.csproj.Fody.RuntimeCopyLocal.cache 0B
Demo.Textbook.WpfApp_2xzhdkzg_wpftmp.csproj.Fody.CopyLocal.cache 0B
Demo.Textbook.WpfApp_egaz0rff_wpftmp.csproj.Fody.CopyLocal.cache 0B
WpfApp3_efqbod0h_wpftmp.csproj.Fody.CopyLocal.cache 0B
Demo.Textbook.WpfApp_43fghdcd_wpftmp.csproj.Fody.RuntimeCopyLocal.cache 0B
共 643 条
- 1
- 2
- 3
- 4
- 5
- 6
- 7
资源评论
今天好像不上班
- 粉丝: 936
- 资源: 12
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- Chrome代理 switchyOmega
- GVC-全球价值链参与地位指数,基于ICIO表,(Wang等 2017a)计算方法
- 易语言ADS指纹浏览器管理工具
- 易语言奇易模块5.3.6
- cad定制家具平面图工具-(FG)门板覆盖柜体
- asp.net 原生js代码及HTML实现多文件分片上传功能(自定义上传文件大小、文件上传类型)
- whl@pip install pyaudio ERROR: Failed building wheel for pyaudio
- Constantsfd密钥和权限集合.kt
- 基于Java的财务报销管理系统后端开发源码
- 基于Python核心技术的cola项目设计源码介绍
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功