开发者

Returning a Dictionary<int, int> or an int[][] on a WCF response

开发者 https://www.devze.com 2023-01-10 14:16 出处:网络
Is it preferable to retu开发者_C百科rn a Dictionary<int, int> or an int[][] on a WCF response? Or does it not matter?They really are two very different things, and serve different purposes.

Is it preferable to retu开发者_C百科rn a Dictionary<int, int> or an int[][] on a WCF response? Or does it not matter?


They really are two very different things, and serve different purposes.

You'd probably want to return Dictionary<int,int> if you're trying to return a mapping from single integers to other single integer values.

If, however, you are returning multiple "lists" of integer values, then a jagged array would be appropriate. In this case, you'd be return an array of arrays of integers: basically, multiple numerical value collections.

0

精彩评论

暂无评论...
验证码 换一张
取 消