I have a WCF service that needs to return different types of Quotes
(ie Quote1, Quote2, Quote3) — all inherit from Quote
My plan is to expose a single method
Quote GetQuote(Message message);
However then I am forcing the client to do something like this
if (quote is Quote1)
elseif (quote is Quote2) etc
Without having a different method for each quote type is there a good way to distinguish Quotes without having the client cast to each type?
Anyone have any suggestions on a better way to do this?
Thanks
If you are using
DataContractsthen you can decorate them with theKnownTypeAttribute.