Dto T4 template stupid question

2 posts, 0 answers
  1. LordRevan007
    LordRevan007 avatar
    20 posts
    Member since:
    May 2011

    Posted 13 Jan 2012 Link to this post

    Hello to all, I downloaded T4 Dto Template from Code Library. I modified the template to suit my need, but somenthing draw my attention. From what I see in the Dto objects only the 1:many relationship is mapped, the many:1 isn't.

    Why is this done? How does Telerik recommends creating Dto object using the template from code library or there is another way?
    Thanks in advance,
    LordRevan007
     
  2. Alexander
    Admin
    Alexander avatar
    727 posts

    Posted 17 Jan 2012 Link to this post

    Hello LordRevan007,

    This DTO template generates only the "collection" part of 1:N associations. For M:N associations, only one of the association ends is generated, which is a collection as well. If the second end was generated in parallel, this would easily lead to errors because of cyclic references during serialization of the object graph. And this is actually the main reason for generating the code this way.
    Hope that helps.

    Greetings,
    Alexander
    the Telerik team
    Want to use Telerik OpenAccess with SQL Azure? Download the trial version today. 
  3. DevCraft banner
Back to Top