Hi
Is there a way to build a recursive DTO template?
What hell is a recursive DTO template?
Well is something I needd....
I have three entity classes (of course the following code is a sample)
class AEntity
{
public string Name {get;set;}
public BEntity ObjectB {get; set;}
}
public BEntity
{
public CEntity ObjectC {get; set;}
}
public CEntity
{
public AEntity ObjectA {get; set;}
}
But I need a more complex DTO Objects generated like
class A
{
public string Name {get;set;}
public B ObjectB {get; set;}
}
public B
{
public C ObjectC {get; set;}
}
public C
{
public A ObjectA {get; set;}
}
There are two problems
- The current DTO Template (http://www.llblgen.com/tinyforum/Messages.aspx?ThreadID=10504&HighLight=1) only generate a plain Object, not analize the other objects
- Like the previous sample, It's posible a recursive references.
What I need?
- A sample of code to build this recursive template
- How to control the recursive deep?
Why I need that template¿?
- For do things like JSON of recursive objects
- There area another way to do this?
Thanks
Sorry my english isn't good