为什么我们不能返回List< T>在ASMX网络服务? [英] Why we cant return List<T> in ASMX web services?
本文介绍了为什么我们不能返回List< T>在ASMX网络服务?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
由于开发人员知道我们不能使用web服务返回 List< T>
,所以我们只能将列表转换为.ToArray();我搜索了一些,但无法得到有效的答案,为什么我们无法重新与Web服务列表。为什么我们必须将它们转换为ToArray(); ?
As developers know we cant return List<T>
with web services, we can only return lists with converting them to .ToArray(); I've searched some, but cant get effective answer about Why we cant retun List with web services. Why we must convert them ToArray(); ?
推荐答案
Web服务应该可以与多种语言互操作。几乎所有的语言都有数组,但只有.NET具有您正在使用的 List< T>
的特定实现。
Web services are supposed to be interoperable with many languages. Nearly all languages have arrays, but only .NET has the specific implementation of List<T>
that you're using.
这篇关于为什么我们不能返回List< T>在ASMX网络服务?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文