Hi everybody,
Last Friday I re-factored my Client class to use complex type for Contact Detail. The Clients table stores two sets of columns for the Contact details so I inrtroduced a new complex type (which also has another complex type PhoneInfo) for Contact1 and Contact2. After spending quite a time chasing my own bug (as it turned at the end) I got everything working correctly.
I also introduced new EditorFor for the ContactDetail class and for the PhoneInfo. Doing this I was able to almost achieve the layout I wanted (and that was the reason I started this exercise).
However, the DataAnnotationExtensions no longer work and the other validation do not seem to fire. The EMail validations did fire before I re-factored that class.
Do you know if it's possible to keep the current more clean design and also keep the validations properly working?
Thanks in advance.
If it's not broken, fix it until it is.
My Blog