thrownewSerializationException(String.Format("Type '{0}' is unexpected. The type should either be registered as a known type, or DataContractResolver should be used.",graph.GetType()));
thrownewSerializationException(String.Format("Expected element '{0}' in namespace '{1}', but found {2} node '{3}' in namespace '{4}'",name,ns,reader.NodeType,reader.LocalName,reader.NamespaceURI));
thrownewSerializationException(String.Format("Expected element '{0}' in namespace '{1}', but found {2} node '{3}' in namespace '{4}'",name,ns,reader.NodeType,reader.LocalName,reader.NamespaceURI));
.Serialize(/*graph != null ? graph.GetType () : */declaredType,graph);// FIXME: I believe it should always use declaredType, but such a change brings some test breakages.