MetadataSection.CreateFromSchema Method (XmlSchema)


Creates a MetadataSection from the specified System.Xml.Schema.XmlSchema object.

Namespace:   System.ServiceModel.Description
Assembly:  System.ServiceModel (in System.ServiceModel.dll)

public static MetadataSection CreateFromSchema(
	XmlSchema schema


Type: System.Xml.Schema.XmlSchema

An XML Schema document.

Return Value

Type: System.ServiceModel.Description.MetadataSection

A MetadataSection containing the specified XML schema.

Exception Condition

The schema is null.

Use this static factory method to quickly create a MetadataSection for a XML Schema document. The Dialect property is assigned the value of XmlSchemaDialect and the Identifier property is assigned the value of the target namespace of the XML Schema document.

.NET Framework
Available since 3.0
Return to top