This is a migrated thread and some comments may be shown as answers.

DataAnnotations in Dtos

2 Answers 99 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
WAF
Top achievements
Rank 1
WAF asked on 09 Aug 2013, 10:32 AM
We modified the TT and TTINCLUDE files for implement INotifyPropertyChanged in Dtos but we want to implement DataAnnotations attributes in Dtos too. 

It's possible?

Thanks.

2 Answers, 1 is accepted

Sort by
0
Accepted
Dimitar Tachev
Telerik team
answered on 14 Aug 2013, 09:01 AM
Hello WAF,

 
It is possible to get the Data Annotation Attributes generated in your DTO classes instead of the Domain ones. 

For your convenience I modified the code generation templates used by the Add OpenAccess Service wizard for generating the DTO classes - please find a sample application demonstrating this approach attached.

In order to use these templates in your project please follow the steps below:

1) Copy the OpenAccessTemplates folder from the web application.
2) Paste the folder in the application where you are generating your service.
3) Regenerate the service to get the modified DTO classes.

Please bear in mind that you should keep the same folder structure as in the sample application - OpenAccessTemplates/Includes/modifiedTTIncludeFiles. Otherwise the modified templates will not be used by the code generation of the services.

I hope this helps. Do not hesitate to contact us back if you need any further assistance.

Regards,
Dimitar Tachev
Telerik
OpenAccess ORM Q2 2013 brings you a more powerful code generation and a unique Bulk Operations support with LINQ syntax. Check out the list of new functionality and improvements shipped with this release.
0
WAF
Top achievements
Rank 1
answered on 19 Aug 2013, 08:13 AM
Thanks a lot. This code is working perfect !! ;)
Tags
General Discussions
Asked by
WAF
Top achievements
Rank 1
Answers by
Dimitar Tachev
Telerik team
WAF
Top achievements
Rank 1
Share this question
or