Can I use a Single WCF method to return a class from multiple classes?
06:13 31 Jul 2015

I have this Model class on c#

public class Enumerator
{
int ID {get;set;}
string Description {get;set;}
}

I also have nearly 20 classes that implement a method to convert them to an Enumerator class.

My question is simple: Is there a way to write a single method on a WCF service to let the client choose which class to Enumerate? The returned type is always and Enumerator class. Or do I have to write 20 Operation Contract, one for each class? That doesn't seems so logical.

This data is used mostly to fill ComboBoxes on client side.

c# wcf contract