Oct 19, 2010 05:34 PM|Yellow Pages of Death|LINK
yeah, ModelMetaData is a tough one with the ViewModel pattern. I solved this by writing my own ModelMetaDataProvider. It is using the mapping information of
AutoMapper to retrieve ModelMetaData from the domain model to be used on the view model (I use this library to map my domain models to my view models). This is the only way I know of to keep your validation- & metadata
DRY while still using the ViewModel pattern. My approach was inspired by the ModelMetaDataProvider used in the MVC library of Jeremy Skinner's
FluentValidation, which I use to define my validation- & metadata. Download the source and have a look - it's not that hard. I even implemented MetaData "inheritance" that way.
By the way - FluentValidation is really worth a try. The best thing is that you can use strongly typed resources for your label's or error messages (you can't do this with attributes) and seperate your metadata from your domain model.
Anyway - you find something better, please let me know - I would be very interested.