Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Gotcha of the Complex Type?
Message
 
 
À
Tous
Information générale
Forum:
ASP.NET
Catégorie:
MVC
Titre:
Gotcha of the Complex Type?
Versions des environnements
Environment:
C# 4.0
OS:
Windows 7
Network:
Windows 2003 Server
Database:
MS SQL Server
Divers
Thread ID:
01555449
Message ID:
01555449
Vues:
52
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
Répondre
Fil
Voir

Click here to load this message in the networking platform