Consider a user profile page. User can add many emails to his/her profile (something like GitHub's profile page).
So, theoretically, user hits the plus button, then enters an email address, and clicks the save button.
Now we have some dispute in our team over how to validate this email address. Some developers (including me) believe that we should validate this simple string via an extension method:
bool isValid = newEmail.IsEmail();
They argue that any validation mechanism other than a single method call would be overhead, and an anti-pattern (against KISS principal).
While others argue that this email should first be added to a new instance of UserEmail DTO, then that DTO should be passed to a the relevant validator:
UserEmail userEmail = new UserEmail() { Email = newEmail };
bool isValid = new UserEmailValidator().Validate(userEmail);
The second group argues that validating a single property makes no sense, because a property can't exist on its own. Thus we should always validate an object, not a property (I mean, value type properties, like strings and integers, etc.)
I searched but didn't find good resources on the net in favor or against these methods. What disadvantage could each approach have? I would be grateful if somebody point me to the right direction and show us best practices for validation.