title: Validation on ViewModels in ASP.NET MVC
body: <p>Most of the tips on how to implement validation in ASP.NET MVC seem to center around the Model (either building service layers between model and controller or decorating properties of the model with validation attributes).</p>
  
  <p>In my application I use ViewModels for all communication between the controllers and the views. </p>
  
  <p>I have a ViewModel for my login page called 'LoginViewModel' with a property called 'EmailAddress'. </p>
  
  <p>When the user enters their email address and clicks submit, this ViewModel is populated and sent to the controller, where the email address is validated.</p>
  
  <p>It must be a valid email address, and the user must be from a domain that's registered with the system.</p>
  
  <p>What would be a convenient way to add validation to this? Should I put the validation in the  ViewModel itself? Or should it stay in the controller?</p>