转换WCF e.result和Generic类

时间:2013-02-07 04:01:41

标签: c# wcf silverlight-4.0

我的wcf服务中有实体类,方法将返回List<MainClass>

在Silverlight应用程序中消耗服务时,e.Result需要访问ForthClass。如何施展e.result?

public class MainClass
{
    public List<SecondClass> SecondClassList { get; set; }
}

public class SecondClass
{
    public List<ThirdClass> ThirdClassList { get; set; }
}

public class ThirdClass
{
    public string Name { get; set; }
}

UI服务电话:

ServiceClient.getNameCompleted += (s, e) =>
{
    ObservableCollection<ThirdClass> test = ((ThirdClass)e.Result[0].SecondClassList).ThirdClassList ;
};

0 个答案:

没有答案