title: Domain logic in a Entity framework Attribute
body: <p>I've an ASP.NET MVC project with a domain and a data layer (contains just EF and migrations).</p>
  
  <p>Now, I have to validate a Client's VATNumber field with a specific formula I'm having doubts where to place it.</p>
  
  <p>I would like to use the Controller's ModelState to check if the field is valid, using a EF DataAnnotation ValidationAttribute, so I don't have to validate it in the Controller's Saving Method. But I'm conflicted having to put business logic in the data layer.</p>
  
  <p>Is there some kind of alternative to ValidationAttribute, so it can be "injected"? Or I'm just looking at this wrongly?</p>