public XmlQualifiedName GetRootElementName(Type type)
{
if (type == null)
throw System.Runtime.Serialization.DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentNullException(nameof(type)));
type = GetSurrogatedType(type);
DataContract dataContract = DataContract.GetDataContract(type);
DataContractSet.EnsureTypeNotGeneric(dataContract.UnderlyingType);
if (dataContract.HasRoot)
{
return new XmlQualifiedName(dataContract.TopLevelElementName.Value, dataContract.TopLevelElementNamespace.Value);
}
else
{
return null;
}
}