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
}
精彩评论