Definition
Assembly: Microsoft.OData.Mcp.Core.dll Namespace: Microsoft.OData.Mcp.Core.ParsingSyntax
Summary
Interface for parsing OData CSDL (Conceptual Schema Definition Language) XML documents into EDM models.Remarks
This interface abstracts the parsing of CSDL XML documents that describe the structure of OData services, including entity types, complex types, entity containers, and their relationships. It supports OData specification versions 4.0 and later.Methods
ParseFromFile Abstract
Parses a CSDL XML document from a file.Syntax
Parameters
| Name | Type | Description |
|---|---|---|
filePath | string | The path to the file containing the CSDL XML content. |
Returns
Type:Microsoft.OData.Mcp.Core.Models.EdmModel
The parsed EDM model.
Exceptions
| Exception | Description |
|---|---|
ArgumentException | Thrown when filePath is null or whitespace. |
FileNotFoundException | Thrown when the file does not exist. |
XmlException | Thrown when the XML is malformed. |
InvalidOperationException | Thrown when the CSDL structure is invalid. |
ParseFromStream Abstract
Parses a CSDL XML document from a stream.Syntax
Parameters
| Name | Type | Description |
|---|---|---|
stream | System.IO.Stream | The stream containing the CSDL XML content. |
Returns
Type:Microsoft.OData.Mcp.Core.Models.EdmModel
The parsed EDM model.
Exceptions
| Exception | Description |
|---|---|
ArgumentNullException | Thrown when stream is null. |
XmlException | Thrown when the XML is malformed. |
InvalidOperationException | Thrown when the CSDL structure is invalid. |
ParseFromString Abstract
Parses a CSDL XML document from a string.Syntax
Parameters
| Name | Type | Description |
|---|---|---|
csdlXml | string | The CSDL XML content as a string. |
Returns
Type:Microsoft.OData.Mcp.Core.Models.EdmModel
The parsed EDM model.
Exceptions
| Exception | Description |
|---|---|
ArgumentException | Thrown when csdlXml is null or whitespace. |
XmlException | Thrown when the XML is malformed. |
InvalidOperationException | Thrown when the CSDL structure is invalid. |