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 ;
};
4

0 回答 0