I was reviewing an older article here (http://msdn.microsoft.com/en-nz/data/gg193959) on validation in EF 4.1 and near the end it has an interesting quote on triggering the validations:
"DbContext.GetValidationErrors will trigger all of the validations, those defined by annotations or the Fluent API, the validation created in IValidatableObject (e.g., Blog.Validate), and the validations performed in the DbContext.ValidateEntity method."
Since you trigger all of the validations with a call to GetValidationErrors, why would you choose one method over the other? I suppose the Fluent API should be
excluded because (I believe) it cannot perform the complex validations at the entity level like IValidatableObject and DbContext.ValidateEntity. But both the entity validation methods appear to
cover the same ground.
So to rephrase, between IValidatableObject and DbContext.ValidateEntity, is there a compelling reason to pick one over the other?