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

# EdmModelAdapter

> Copies declared [IEdmModel](https://learn.microsoft.com/dotnet/api/microsoft.odata.edm.iedmmodel) members into the Core EDM projection. CLR properties ignore...

## Definition

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

**Namespace:** Microsoft.OData.Mcp.AspNetCore.Adaptation

**Inheritance:** System.Object

## Syntax

```csharp theme={null}
Microsoft.OData.Mcp.AspNetCore.Adaptation.EdmModelAdapter
```

## Summary

Copies declared [IEdmModel](https://learn.microsoft.com/dotnet/api/microsoft.odata.edm.iedmmodel) members into the Core EDM projection.
CLR properties ignored on the OData model are never copied.

## Methods

### &#x20;ToCoreModel

Projects an [IEdmModel](https://learn.microsoft.com/dotnet/api/microsoft.odata.edm.iedmmodel) into the Core EDM used by catalogs.

#### Syntax

```csharp theme={null}
public static Microsoft.OData.Mcp.Core.Models.EdmModel ToCoreModel(Microsoft.OData.Edm.IEdmModel model)
```

#### Parameters

| Name | Type | Description |
| - | - | - |
| `model` | `Microsoft.OData.Edm.IEdmModel` | The ASP.NET Core OData model. |

#### Returns

Type: `Microsoft.OData.Mcp.Core.Models.EdmModel`
The Core projection containing only declared members and vocabulary documentation.

### &#x20;ToCsdlXml

Serializes an [IEdmModel](https://learn.microsoft.com/dotnet/api/microsoft.odata.edm.iedmmodel) to a CSDL XML document, the same representation the
service returns from `$metadata`.

#### Syntax

```csharp theme={null}
public static string ToCsdlXml(Microsoft.OData.Edm.IEdmModel model)
```

#### Parameters

| Name | Type | Description |
| - | - | - |
| `model` | `Microsoft.OData.Edm.IEdmModel` | The ASP.NET Core OData model. |

#### Returns

Type: `string?`
The CSDL XML, or `null` when the model cannot be written (the writer reports validation errors).

#### Remarks

In-process hosts do not fetch `$metadata` over HTTP, so this is how the
`odata://{prefix}/$metadata` MCP resource gets its text. A `null` result leaves that resource
empty rather than failing session construction.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.