开发者

can some one help me how to use IList in c#

I'm am trying to test wcf method in C#. method return type is ilist. I need to catch that returned data in to an ilist and then i have to retrive each item from ilist. c开发者_StackOverflow社区an some one send me a sample code how to do this?


It's perfectly fine to just iterate over an IList if that is what you're asking.

foreach(var item in MethodThatReturnsIList())
{
   // Do whatever
}


Here is some template code. I don't know what the generic type that is being returned, so I put place holders for it.

IList<type of result> list = data.ReturnIList();
foreach(var item in list)
{
   //do stuff with the item
}
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜