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
)

Parameters

typeName
Type: System.Xml.XmlQualifiedName

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

element
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
Available since 3.0
Return to top
Show: