DTO To Entity FullGraph projection

Posts   
 
    
rlmartins
User
Posts: 5
Joined: 03-Oct-2016
# Posted on: 03-Oct-2016 22:12:32   

Hi,

Is there a way to Populate the full graph for and Entity having its DTO as source?

Thanks Ricardo

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39588
Joined: 17-Aug-2003
# Posted on: 04-Oct-2016 09:48:11   

When you generate derived models as read/write, you'll get code which materializes the root entity from the dto, but not related entities. This is because DTOs often don't contain enough information to materialize the related entities (e.g. no pk values) and are often projections of the related entities, not the related entities themselves. After all, the derived models are not said to be 1:1 copies of the entities. So if you want to do this, you have to write the code yourself.

Are you editing entities through DTOs in a graph form btw? We found only use cases where root entities were edited through DTOs but not in graph form. If you do that, why not just transport the entities as a graph?

Frans Bouma | Lead developer LLBLGen Pro
rlmartins
User
Posts: 5
Joined: 03-Oct-2016
# Posted on: 04-Oct-2016 15:46:52   

Otis,

Thanks for the explanation. My needs are pretty modest. I will take an attempt on creating the code.

Thanks Ricardo