icon

CodeTrigger   Forum

Code Generation For C#, WPF, WCF, SQL SERVER/ORACLE/MYSQL and Visual Studio 2013-2017

HomeGeneral

General Discussion Board - Please post questions, answers, (polite) opinions, and use-cases. Moderators reserve the right to amend the text/subject line or re-categorise the post to better suit the forum configuration if necessary.

Transferring hierarchical data structure across Messages in this topic - RSS

migrator
03/12/2017
migrator
Administrator
Posts: 63
migrator
migrator
Administrator
Posts: 63
I have an application where I need to allow the user to post a single object to the database so I can allow the user to share that information with a group of users. A simplified generated object structure is like this, and each corresponds to a table that code trigger has created an equivalent data and business object.


Project Table
ID
Name


--- SubProject Table
--- ID
--- Name
--- Comments
--- ProjectID


-------- WorkDetails Table
-------- ID
-------- Name
-------- Details
-------- SubProjectID


What is the best way to get all the information across for a specific project instance and its associated child tables so that I can recreate it on the server side? When I try to serialize it, it only returns the project object, no child collections. Your wcf sample version does the same thing. Is there a better way to do this, because essentially I need to have the client send my the project object and its hierarchy and then create a new version of it on the server. The only other option is manually call each one from project on down, but that could result in quite a few calls. Any suggestion would be appreciated
0 link
03/12/2017 migrator
Administrator
Posts: 63
migrator
migrator
Administrator
Posts: 63
This is an interesting question. We have created a tutorial/sample page about how you can do this:
Transferring deep collections using Wcf
and
Transferring deep collections using restApi
edited by migrator on 12/3/2017
0 link