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

Dto T4 template stupid question

1 Answer 71 Views
Data Access Free Edition
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
LordRevan007
Top achievements
Rank 1
LordRevan007 asked on 13 Jan 2012, 08:16 AM
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
 

1 Answer, 1 is accepted

Sort by
0
Alexander
Telerik team
answered on 17 Jan 2012, 01:58 PM
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. 
Tags
Data Access Free Edition
Asked by
LordRevan007
Top achievements
Rank 1
Answers by
Alexander
Telerik team
Share this question
or