views:

20

answers:

0

I have a class that contain a base class by composition.

So Foo.BaseClass is needed when you load Foo. I have another class that contain a collection of Foos (Bar.Foos). Using DataServices is there a way to force the expand of the Foo/BaseClass from the Bar.Foos field.

Sending a serie of LoadProperty for each baseclass of the collection is out of the question. a Foo without Foo.BaseClass is not valid.

My code look like this

DataServiceContext.BeginLoadProperty(bar, "Foos",
                            aResult =>
                            {
                                var del2 = new SendOrPostCallback(delegate(object state2)
                                {
                                    QueryOperationResponse Result = null;
                                    try
                                    {
                                        Result = DataServiceContext.EndLoadProperty(aResult);
                                    }
                                    catch (Exception e)
                                    {
                                        Exception = e;
                                    }
                                });

                                del2(null);

                            }, null);

regards