Root object with six/seven child objects. #3761
-
We have a root object that has six/seven child objects (long story about the UI). |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 11 replies
-
We have similar abominations :). We started to switch to load the whole "object graph" from the database where possible in one go. Especially with child-lists to increase performance. Each database call costs you "time" which is even within our company network noticable. |
Beta Was this translation helpful? Give feedback.
-
Another possible option is to do the data calls and loading for the parent and children asynchronously. This way they can be loaded simultaneously. I've done this a few times with large object graphs and it's been very fast. In the beginning of the Fetch I create all the fetch tasks for the parent and children and then use await Task.WhenAll(....) and set the children with the results of the tasks. |
Beta Was this translation helpful? Give feedback.
As already stated. One tailored DB call is faster than multiple. But it really depends on your data structure. For us one time loading is in most cases faster.