KnownTypeAttribute enable you to designate acceptable derived class for a given Data Contract. It specifies types that should be recognized by the DataContractSerializer when serializing or deserializing a given type.
One simple example.
[ServiceContract()]
interface ITaskManager
{
[OperationContract()]
MyCollection GetTaskByAssignedName(string name);
}
[DataContract()]
[KnownType(typeof(DerivedTask))]
class Task
{
}
[DataContract()]
class DerivedTask
{
}
When working with polymorphic types in your service contract, the KnownTypeAttribute is required because polymorphism is outside the paradigm of the service orientation.
Apply the KnownTypeAttribute attribute to a type to indicate to the
DataContractSerializer types that should be recognized when
serializing or deserializing an instance of the type to which the
attribute is applied. This attribute could also be recognized by other
serializers that understand data contracts.
Look at here for more details.