If you are working with Validating a Entity , Simple Meta Data Validation is not always enough , you might have to do a server side validation, and it is really simple
Along with regular metadata add a Custom Validation Attribute which has type of class where your validation logic resides and String name of the Validation Function