У меня проблема с веб-сервисами asmx. У меня есть эти объекты
public class animal
{
public string id = null;
public string name = null;
}
public class dog: animals
{
public string surname = null;
public string color = null;
}
и веб-сервис
public animal GetAnimal()
{
animal result = new dog();
return result;
}
проблема в том, что мой веб-сервис всегда возвращает собаку. Есть ли простой способ вернуть животное?
(Я вижу 2 решения, которые мне не нравятся:
animal result = new animal();
или
animal resultDog = new dog();
animal result = new animal();
result.id = resultDog.id
result.color = resultDog.color
)