Skip to main content

Posts

Showing posts from November, 2017

Centralized model validation both for MVC/WebApi and SPA client-side validation using FluentValidation

Validation is one of the crucial parts of any application. It has to validate on both client side and server side requests.
What are target features or implementation from this article?Model validation for any given model.Centralized/One code for validation on both server-side and client-side.Automatic validation of model without writing any extra codes on/under actions for validation. NO EXTRA/ANY codes on client-side to validate any form.Compatible with SPA.Can be compatible with any client-side validation framework/library. Like Angular Reactive form validation or any jquery validation libraries. Tools used in the implementation?FluentValidation: I feel DataAnnotation validation are excellent and simple to use, but in case of complex validation or writing any custom validations are always tricker and need to write a lot of codes to achieve whereas FluentValidations are simple even in case of complex validation. Generally, we need to validate incoming input against database values,…