Consider a webmethod which exposes an abstract class:
[WebMethod]
public void Save(AbstractEntity obj)
{
// ..
}
There are several classes inheriting from AbstractEntity
like
public class Patient : AbstractEntity
{
// ...
}
Now I want to enable the webservice consumer to create a new Patient object and save it:
service.Save(new Patient { Name = "Doe", Number = "1234567" });
Because "Save" takes an AbstractEntity, there will be no Patient proxy on the client side. I could of course create a dummy method which exposes a Patient, but I'm hoping there is a better way.
How do I expose the Patient class and other classes not directly referenced in the webservice interface in a nice way?