mentor360
asked on
Polymorphism in WCF DataContracts
Hi,
I would like to know if it's possible to use polymorphism in DataContract classes for a WCF service.
lets say i have a method GetAll
Also I have several classes extending BasicDTO. Lets call one ComplexDTO a class that also has 2 more properties.(creatonDate and creationUser). Both properties with the [DataMember] attribute.
Is it possible to return a IEnumerable<ComplexDTO> in the GetAll Implementation? Will the extra properties of ComplexDTO arrive to the client?
Thank You.
I would like to know if it's possible to use polymorphism in DataContract classes for a WCF service.
lets say i have a method GetAll
[OperationContract]
IEnumerable<BasicDTO> GetAll();
in my service. This method returns a collection of BasicDTO. This DTO has a code and a name properties.Also I have several classes extending BasicDTO. Lets call one ComplexDTO a class that also has 2 more properties.(creatonDate and creationUser). Both properties with the [DataMember] attribute.
Is it possible to return a IEnumerable<ComplexDTO> in the GetAll Implementation? Will the extra properties of ComplexDTO arrive to the client?
Thank You.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.