Export (0) Print
Expand All

XsdDataContractImporter.GetCodeTypeReference Method (XmlQualifiedName, XmlSchemaElement)

Returns a CodeTypeReference for the specified XML qualified element and schema element.

Namespace:  System.Runtime.Serialization
Assembly:  System.Runtime.Serialization (in System.Runtime.Serialization.dll)

public CodeTypeReference GetCodeTypeReference(
	XmlQualifiedName typeName,
	XmlSchemaElement element


Type: System.Xml.XmlQualifiedName

An XmlQualifiedName that specifies the XML qualified name of the schema type to look up.

Type: System.Xml.Schema.XmlSchemaElement

An XmlSchemaElement that specifies an element in an XML schema.

Return Value

Type: System.CodeDom.CodeTypeReference
A CodeTypeReference that represents the type that was generated for the specified schema type.

The schema element is needed for data about the type that is specified at the element scope. The main example of this is the XSD attribute nillable. In schema, setting nillable to true is specified on the containing schema element whereas the concept of null is expressed in the CLR type Nullable<T>. The element is passed in so that this importer can look up the element-level information and return the correct type reference accordingly.

When importing WSDL, each parameter is imported separately and therefore the parameter elements need to be passed in separately.

.NET Framework

Supported in: 4.5.2, 4.5.1, 4.5, 4, 3.5, 3.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

© 2014 Microsoft