I have an auto-generated WCF Client and I thought that I would be able to add Data Annotations by using a partial class and adding a Metedatatype attribute to it. Seemingly this will not work; as I have seen from other posts the MetadataType needs to be registered and I have tried this approach but with no success.
Validation works if I place a validation attribute directly on the field, and maybe I should do this and manually create the client DTOs, but I was wondering if anyone out there knew of a way to get this working.
I will happily post some code if people think it will help.
Thanks.
Create in your solution another project (let's call it "SolutionName.Infrastructure") responsible for storing DataContracts and ServiceContracts. Then in your service and client projects add reference to Infrastructure project. Such a solution declines the amount of code being created since now you store all code in one place depriving of auto-generated code. You can effortlessly leverage of DataAnnotations. The downside is that you need to adjust app.config file on client side manually.