> ## Documentation Index
> Fetch the complete documentation index at: https://easyaf.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# ICsdlMetadataParser

> Interface for parsing OData CSDL (Conceptual Schema Definition Language) XML documents into EDM models.

export function DocsBadge({text, variant = 'neutral'}) {
  const variantClasses = {
    success: 'mint-bg-green-500/10 mint-text-green-600 dark:mint-text-green-400 mint-border-green-500/20',
    neutral: 'mint-bg-slate-500/10 mint-text-slate-600 dark:mint-text-slate-400 mint-border-slate-500/20',
    info: 'mint-bg-blue-500/10 mint-text-blue-600 dark:mint-text-blue-400 mint-border-blue-500/20',
    warning: 'mint-bg-amber-500/10 mint-text-amber-600 dark:mint-text-amber-400 mint-border-amber-500/20',
    danger: 'mint-bg-red-500/10 mint-text-red-600 dark:mint-text-red-400 mint-border-red-500/20'
  };
  const classes = variantClasses[variant] || variantClasses.neutral;
  return <span className={`mint-inline-flex mint-items-center mint-px-2 mint-py-0.5 mint-rounded-full mint-text-xs mint-font-medium mint-tracking-wide mint-border mint-ml-1.5 mint-align-middle mint-whitespace-nowrap ${classes}`}>
      {text}
    </span>;
}

## Definition

**Assembly:** Microsoft.OData.Mcp.Core.dll

**Namespace:** Microsoft.OData.Mcp.Core.Parsing

## Syntax

```csharp theme={"dark"}
Microsoft.OData.Mcp.Core.Parsing.ICsdlMetadataParser
```

## 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

### <Icon icon="function" iconType="duotone" color="#419AC5" size={24} style={{ paddingRight: '8px' }} />  ParseFromFile <DocsBadge text="Abstract" variant="warning" />

Parses a CSDL XML document from a file.

#### Syntax

```csharp theme={"dark"}
Microsoft.OData.Mcp.Core.Models.EdmModel ParseFromFile(string filePath)
```

#### 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.    |

### <Icon icon="function" iconType="duotone" color="#419AC5" size={24} style={{ paddingRight: '8px' }} />  ParseFromStream <DocsBadge text="Abstract" variant="warning" />

Parses a CSDL XML document from a stream.

#### Syntax

```csharp theme={"dark"}
Microsoft.OData.Mcp.Core.Models.EdmModel ParseFromStream(System.IO.Stream stream)
```

#### 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. |

### <Icon icon="function" iconType="duotone" color="#419AC5" size={24} style={{ paddingRight: '8px' }} />  ParseFromString <DocsBadge text="Abstract" variant="warning" />

Parses a CSDL XML document from a string.

#### Syntax

```csharp theme={"dark"}
Microsoft.OData.Mcp.Core.Models.EdmModel ParseFromString(string csdlXml)
```

#### 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.   |
