This project has moved and is read-only. For the latest updates, please go here.

Diagram-wide model validation

Oct 19, 2012 at 6:51 AM


What is the proper place for diagram-wide model validation? For example, I want to validate that all models have unique Code property; as far as this validation assumes checking the whole Diagram, it cannot be placed in the model class.

Thank you.

Oct 23, 2012 at 8:57 AM

That's a question I cannot answer properly because it's completely depending on the architecture of your application. The framework does not care about model validation as the model part is completely optional and meant to be implemented in the host application.

Regarding your question, I think calling your host application's model validation routine before calling IRepository.SaveChanges is not a bad choice...

Oct 23, 2012 at 9:28 AM

Well, I agree it was a strange question :) It's completely up to the app author to decide where all models should be validated. Sorry.