Returning a collection of objects from a webmethod

Posted by Narmatha Balasundaram on Stack Overflow See other posts from Stack Overflow or by Narmatha Balasundaram
Published on 2010-04-20T16:43:31Z Indexed on 2010/04/20 16:53 UTC
Read the original article Hit count: 282

Filed under:
|

How do I return a collection of objects from a webmethod? And can this collection of objects be of different types - say of these 3 classes,

private class ClassA 
{
  int A1;
  int A2;
}

private class ClassB
{
  int B1;
}

private class ClassC
{
  int C1;
}

ClassA objA = new ClassA(...);
ClassB objB = new ClassB(...);
ClassC objC = new ClassC(...);

How can I return the objects, objA, objB and objC from a method?

© Stack Overflow or respective owner

Related posts about c#

Related posts about .NET