Is there a way in ASP.NET MVC to use some kind of smooth validation?
I mean, instead of checking my poco, like this:
public class User {
[Required]
public int Id { get; set; }
The presence of something like this (in the outer class):
User.Validate("Required", "Id");
Is this something possible in Asp.Net MVC 2 (or 3)?
I know that there is a FluentValidation library , but I would like to know if this allows something in the Asp.Net MVC core.
I do not like to pollute my POCO. Also, what happens if I need to check, let them say that BeginDate is before EndDate? With an attribute you cannot do this.
source
share