Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我需要定义一个在.NET 中返回多个数组的方法。我曾尝试使用“元组”,但它需要将该方法声明为“私有”。就我而言,我正在使用 Web 服务,当我将方法声明为私有时,它不会出现在 Web 服务的方法列表中。有人可以建议我该怎么做吗?
例如,您可以返回一个IEnumerable<int[]>。只要确保您使用正确的类型而不是int.
IEnumerable<int[]>
int
顺便说一句:使用Tuple并不意味着您必须将您的方法设为私有。还有其他事情发生。
Tuple