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

# ODataMcpRouteDiscovery

> Discovers `(prefix, IEdmModel)` pairs from ASP.NET Core endpoint routing without compiling against Microsoft.AspNetCore.OData 7 or 8.

## Definition

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

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

**Inheritance:** System.Object

## Syntax

```csharp theme={null}
Microsoft.OData.Mcp.AspNetCore.Hosting.ODataMcpRouteDiscovery
```

## Summary

Discovers `(prefix, IEdmModel)` pairs from ASP.NET Core endpoint routing without compiling against
Microsoft.AspNetCore.OData 7 or 8.

## Methods

### &#x20;Discover

Discovers OData prefixes and models from explicit registration, endpoint metadata, OData 7/Restier
catch-all routes, and (when present) an already-loaded OData options dictionary.

#### Syntax

```csharp theme={null}
public static System.Collections.Generic.IReadOnlyList<Microsoft.OData.Mcp.AspNetCore.Hosting.ODataMcpRouteBinding> Discover(System.IServiceProvider services, Microsoft.OData.Mcp.AspNetCore.Hosting.ODataMcpHostOptions options, System.Collections.Generic.IEnumerable<Microsoft.AspNetCore.Routing.EndpointDataSource> additionalSources = null)
```

#### Parameters

| Name | Type | Description |
| - | - | - |
| `services` | `System.IServiceProvider` | The application service provider. |
| `options` | `Microsoft.OData.Mcp.AspNetCore.Hosting.ODataMcpHostOptions` | Host include/exclude and explicit routes. |
| `additionalSources` | `System.Collections.Generic.IEnumerable<Microsoft.AspNetCore.Routing.EndpointDataSource>?` | Extra data sources (typically `WebApplication.DataSources`) that may not be in DI yet. |

#### Returns

Type: `System.Collections.Generic.IReadOnlyList<Microsoft.OData.Mcp.AspNetCore.Hosting.ODataMcpRouteBinding>`
Bindings after include/exclude filters. Duplicate prefixes keep the last discovered model.


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