I am trying to wrap my head around doing validation in a MVC scenario. I have my application setup so that it has a Data/Repository layer that uses Linq2SQL and creates objects in my domain model. I don't expose my Linq2SQL objects directly to the rest of my app however, for now, my domain model mostly looks like my database tables. I wanted to do this in case I wanted to drop Linq2SQL later.
Then I have a service layer that is called from my controllers to perform actions and grab my domain model from my Data layer.
I want to use a validation framework such as xVal. It seems common wisdom that your model should contain your validation rules. My question is how do you validate part of the model (or various states)? For instance, I have a User object that has username, password and other properties. I have a Login action where I'd like to make sure the Username and Password are provided. However, when I create a new user, I'd want more fields to be required. It seems weird to create a Login object in my model when I already have my User object.
Right now, my Login action is just taking a username and password parameter that are posted to it.