I am trying to deep load an entity in my solution for display on a web page. Ideally I would like to use the deeploadbyvideoid function, but I cannot without getting an exception.
My "object graph" is as follows:
Video
--Director
--Studio
--Country
--TList<Scenes>
----TList<Stars>
----TList<Extra>
I call the videoService.DeepLoadByVideoID function by:
Video video = videoService.DeepLoadByVideoID(1, true, DeepLoadType.IncludeChildren, typeof(Director), typeof(Studio), typeof(Country), typeof(TList<Scene>), typeof(TList<Stars>), typeof(TList<Extra>);
I would expect that I could then call video.SceneCollection[0].StarCollection[0].StarName, but a stack overflow occurs during the DeepLoadByVideoID call, in CommonRules.cs on line 104. The line reads: PropertyInfo p = target.GetType().GetProperty(e.PropertyName); The method call is StringMaxLength, which is being called recursively in a loop, hence the stack overflow (at least it errored out a few times there on my system).
If I change the above statement to remove Stars and Extra TList's, the code works for the requested types. My workaround was to loop through each scene, calling the starService.GetBySceneIDFromSceneStar and extraService.GetBySceneIDFromSceneExtra methods, adding them manually to the current scene.StarCollection and scene.ExtraCollection.
Is there a problem with the way I am calling the code?
BTW, thanks for creating such great a great framework!
Thanks!
Ryan