DataAnnotations in Dtos

3 posts, 1 answers
  1. WAF
    WAF avatar
    2 posts
    Member since:
    Aug 2013

    Posted 09 Aug 2013 Link to this post

    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?

  2. Answer
    Dimitar Tachev
    Dimitar Tachev avatar
    67 posts

    Posted 14 Aug 2013 Link to this post

    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.

    Dimitar Tachev
    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.
  3. DevCraft banner
  4. WAF
    WAF avatar
    2 posts
    Member since:
    Aug 2013

    Posted 19 Aug 2013 Link to this post

    Thanks a lot. This code is working perfect !! ;)
Back to Top