Print Page | Close Window

RelatedList validated with data annotations

Printed From: IdeaBlade
Category: DevForce
Forum Name: DevForce 2010
Forum Discription: For .NET 4.0
URL: http://www.ideablade.com/forum/forum_posts.asp?TID=4093
Printed Date: 12-May-2026 at 9:30pm


Topic: RelatedList validated with data annotations
Posted By: jsalcedok
Subject: RelatedList validated with data annotations
Date Posted: 03-Apr-2013 at 9:51am
Hello:
I don't know if is possible to validate a property of type "RelatedEntityList" with a data annotation (custom verifier validator) and how?. Thanks so much in advance for your answer.



Replies:
Posted By: kimj
Date Posted: 03-Apr-2013 at 6:57pm
DevForce won't automatically perform validation on a RelatedEntityList. You can instead try doing the validation on the scalar side of the relationship, adding the annotation on either, or both, the scalar navigation property and the corresponding FK property.

You can also try adding a "BeforeGet" or "AfterGet" property interceptor for your RelatedEntityList. Within the interceptor you can then force validation on the entity or specific properties, or perform other actions. Setter interceptors aren't provided for these properties.

What sort of validation do you want to provide on the list?



Print Page | Close Window