FluentValidation – build strongly-typed validation rules in .NET

Sending
User Review
0 (0 votes)

Install the FluentValidation .NET library for validation. Below is our sample Contact class and its corresponding validator class. The validator class needs to inherit AbstractValidator<Contact> and define the validation rules in the constructor using the RuleFor method. Instantiate the validator class, and pass the object to be validated. Here we have passed incorrect values for … Continue reading “FluentValidation – build strongly-typed validation rules in .NET”