Skip to main content

Definition

Assembly: Microsoft.OData.Mcp.AspNetCore.dll Namespace: Microsoft.OData.Mcp.AspNetCore.Routing Inheritance: System.Object

Syntax

Microsoft.OData.Mcp.AspNetCore.Routing.ODataMcpRouteConvention

Summary

Automatically adds MCP endpoints to OData routes during registration.

Remarks

This convention ensures that for each OData route registered, corresponding MCP endpoints are automatically created as siblings to the $metadata endpoint.

Constructors

.ctor

Initializes a new instance of the ODataMcpRouteConvention class.

Syntax

public ODataMcpRouteConvention(Microsoft.Extensions.Options.IOptions<Microsoft.OData.Mcp.Core.ODataMcpOptions> options, Microsoft.OData.Mcp.Core.Routing.IMcpEndpointRegistry endpointRegistry)

Parameters

NameTypeDescription
optionsMicrosoft.Extensions.Options.IOptions<Microsoft.OData.Mcp.Core.ODataMcpOptions>The MCP options.
endpointRegistryMicrosoft.OData.Mcp.Core.Routing.IMcpEndpointRegistryThe MCP endpoint registry.

Exceptions

ExceptionDescription
ArgumentNullExceptionThrown when required parameters are null.

.ctor Inherited

Inherited from object

Syntax

public Object()

Methods

ApplyConvention

Applies MCP conventions to the endpoint route builder.

Syntax

public void ApplyConvention(Microsoft.AspNetCore.Routing.IEndpointRouteBuilder endpointRouteBuilder, string routePrefix, string routeName)

Parameters

NameTypeDescription
endpointRouteBuilderMicrosoft.AspNetCore.Routing.IEndpointRouteBuilderThe endpoint route builder.
routePrefixstringThe OData route prefix.
routeNamestringThe OData route name.

Equals Inherited Virtual

Inherited from object

Syntax

public virtual bool Equals(object obj)

Parameters

NameTypeDescription
objobject?-

Returns

Type: bool

Equals Inherited

Inherited from object

Syntax

public static bool Equals(object objA, object objB)

Parameters

NameTypeDescription
objAobject?-
objBobject?-

Returns

Type: bool

GetHashCode Inherited Virtual

Inherited from object

Syntax

public virtual int GetHashCode()

Returns

Type: int

GetType Inherited

Inherited from object

Syntax

public System.Type GetType()

Returns

Type: System.Type

MemberwiseClone Inherited

Inherited from object

Syntax

protected internal object MemberwiseClone()

Returns

Type: object

ReferenceEquals Inherited

Inherited from object

Syntax

public static bool ReferenceEquals(object objA, object objB)

Parameters

NameTypeDescription
objAobject?-
objBobject?-

Returns

Type: bool

ToString Inherited Virtual

Inherited from object

Syntax

public virtual string ToString()

Returns

Type: string?
  • Microsoft.OData.Mcp.AspNetCore.Routing.IMcpRouteConvention