I’m using a DbContext provided by a DomainService in my Silverlight 5 (Beta) application. I’m getting warning messages while building the project:
The attribute 'System.ComponentModel.DataAnnotations.MaxLengthAttribute' requires a reference to System.ComponentModel.DataAnnotations in the client project. Skipping generation of attribute. Please add a reference to System.ComponentModel.DataAnnotations to ensure generation of the attribute.
The thing is that, there is no MaxLengthAttribute attribute in System.ComponentModel.DataAnnotations at client side. In consequence, I’m not able to validate any property length before the record has been sent to the server … Does anybody know a solution?
MaxLengthAttributeis in EntityFramework.dll and I’m almost sure that it cannot be used in Silverlight because it would require Silverlight version of EntityFramework.dll which doesn’t exist.