Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Gotcha of the Complex Type?
Message
 
 
To
All
General information
Forum:
ASP.NET
Category:
MVC
Title:
Gotcha of the Complex Type?
Environment versions
Environment:
C# 4.0
OS:
Windows 7
Network:
Windows 2003 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01555449
Message ID:
01555449
Views:
53
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
Reply
Map
View

Click here to load this message in the networking platform