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?
Return them as an array or list. I don’t have an IDE in front of me, but it should be like
Even better if they inherit from the same base class or interface.