microsoft / Trill

Trill is a single-node query processor for temporal or streaming data.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ReflectionSchemaBuilder ignores knownTypes of the nested type

Poytr1 opened this issue · comments

Repro code:

public interface IFunctionBinding
{
}

[DataContract]
public class AFunctionBinding : IFunctionBinding
{
    [DataMember]
    public int Number { get; set; }
}

[DataContract]
[KnownType(typeof(AFunctionBinding))]
public class FunctionDefinition
{
    [DataMember]
    public IFunctionBinding FunctionBinding { get; set; }
}

var serializer = StreamSerializer.Create<FunctionDefinition[]>();

It throws Exception:
System.Runtime.Serialization.SerializationException: Could not find any matching known type for 'SimpleTesting.IFunctionBinding'.