I\'m implementing an Api with ServiceStack. One of the key aspects of my solution is an aggressive validation strategy.
I use ServiceStack\'s ValidationFeature, mean
Yes it is incorrect to perform the check for the existence of a database record in validation logic, because this is not a validation check. Which is why it is not done in the examples this way.
Checking for the existence of a record is a verification check. By way of an example to illustrate this:
If you take a Credit Card Number, you can use Luhn Algorithm to validate that the credit card number is valid. That would be done in a validator, because it is validation.
But just because you have a valid number doesn't mean it exists, you may have a valid number for a card not yet issued. It would be incorrect to use a validator to verify that it exists, because this is a verification process, and should be done in the business logic.
When you start using the database to check for existence of stuff you are out of the realm of validation, because you should only ever pass validated data to the database.
You can read more about the difference between validation and verification here.