Reputation: 839
[ServiceContract]
[ServiceKnownType(typeof(DBReq))]
public interface IDAService
{
[DataContract]
[KnownType(typeof(IDataParameterCollection))]
public class DBReq : DBAccess
{
[DataMember]
public IDataParameterCollection DataParams
{
...
Why does DataParams deserialize to type of Object on my client side?
Upvotes: 0
Views: 878
Reputation: 31750
Your [KnownType(typeof(IDataParameterCollection))]
is not correct. You should pass the implementing types to the KnownType attribute.
For example
public class MyType : IDataParameterCollection {...}
[DataContract]
[KnownType(typeof(MyType))]
public class DBReq : DBAccess
{
[DataMember]
public IDataParameterCollection DataParams
{
...
Upvotes: 1