Exemplo n.º 1
0
            public PartInfo(MessagePartDescription description, XmlDictionaryString dictionaryName, XmlDictionaryString dictionaryNamespace,
                            IList <Type> knownTypes, DataContractSerializerOperationBehavior behavior)
            {
                this.dictionaryName      = dictionaryName;
                this.dictionaryNamespace = dictionaryNamespace;
                this.description         = description;
                this.knownTypes          = knownTypes;
                serializerFactory        = behavior;

                contractType = DataContractSerializerOperationFormatter.GetSubstituteDataContractType(description.Type, out isQueryable);
            }
Exemplo n.º 2
0
        object DeserializeHeaderContents(XmlDictionaryReader reader, MessageDescription messageDescription, MessageHeaderDescription headerDescription)
        {
            bool isQueryable;
            Type dataContractType = DataContractSerializerOperationFormatter.GetSubstituteDataContractType(headerDescription.Type, out isQueryable);
            XmlObjectSerializer serializerLocal = serializerFactory.CreateSerializer(dataContractType, headerDescription.Name, headerDescription.Namespace, knownTypes);
            object val = serializerLocal.ReadObject(reader);

            if (isQueryable && val != null)
            {
                return(Queryable.AsQueryable((IEnumerable)val));
            }
            return(val);
        }