I'm using Silverlight + EntityFramework + RIA Services in a business application. The underlying database tables include the Humans table and the HumanAddresses table. Every human can have one or more addresses of different types (e.g. home, job, place of birth, etc). At least one address of type "Home" must always be present.
The UI allows to edit, remove and add new several addresses of a given human before submitting. I need to perform validation to find out whether these changes violate the forenamed rule. What is the best way to do this?
I tried using CustomValidationAttribute, but it allows (AFAIK) only entity-level validation, not validation across multiple entities, some of which are to be deleted, while others are to be added or modified.