Skip to main content

Definition

Assembly: Microsoft.Extensions.DependencyInjection.Abstractions.dll Namespace: Microsoft.Extensions.DependencyInjection

Syntax

Summary

This type is defined in Microsoft.Extensions.DependencyInjection.Abstractions.

Remarks

See Microsoft documentation for more information about the rest of the API.

Methods

AddODataHttpClient Extension

Extension method from Microsoft.Extensions.DependencyInjection.ODataMcp_Core_ServiceCollectionExtensions
Adds a configured HTTP client for OData service communication.

Syntax

Parameters

Returns

Type: Microsoft.Extensions.DependencyInjection.IServiceCollection The service collection for chaining.

Examples

Remarks

Registers a named HTTP client “OData” configured with standard OData headers and authentication. This method is called automatically by AddODataMcpCore but can be used independently if needed.

AddODataHttpClient Extension

Extension method from Microsoft.Extensions.DependencyInjection.ODataMcp_Core_ServiceCollectionExtensions
Adds a configured HTTP client for OData service communication with a custom name.

Syntax

Parameters

Returns

Type: Microsoft.Extensions.DependencyInjection.IServiceCollection The service collection for chaining.

Exceptions

Examples

Remarks

Registers a named HTTP client configured for OData communication. The client is configured with:
  • Standard OData headers (Accept, OData-Version, OData-MaxVersion)
  • Base URL from configuration
  • Authentication headers based on configuration (Bearer, API Key, or Basic)
  • Timeout settings from configuration

AddODataMcp Extension

Extension method from Microsoft.Extensions.DependencyInjection.ODataMcp_AspNetCore_ServiceCollectionExtensions
Adds OData MCP automatic routing services to the service collection.

Syntax

Parameters

Returns

Type: Microsoft.Extensions.DependencyInjection.IServiceCollection The service collection for chaining.

Examples

AddODataMcp Extension

Extension method from Microsoft.Extensions.DependencyInjection.ODataMcp_AspNetCore_ServiceCollectionExtensions
Adds OData MCP automatic routing services to the service collection with configuration.

Syntax

Parameters

Returns

Type: Microsoft.Extensions.DependencyInjection.IServiceCollection The service collection for chaining.

Exceptions

Examples

AddODataMcpCore Extension

Extension method from Microsoft.Extensions.DependencyInjection.ODataMcp_Core_ServiceCollectionExtensions
Adds core OData MCP Server services to the service collection.

Syntax

Parameters

Returns

Type: Microsoft.Extensions.DependencyInjection.IServiceCollection The service collection for chaining.

Exceptions

Examples

Remarks

Registers all core services required for OData MCP functionality, including parsers, tool generators, and HTTP clients. Configuration is loaded from the “McpServer” section of the provided IConfiguration.

AddODataMcpCore Extension

Extension method from Microsoft.Extensions.DependencyInjection.ODataMcp_Core_ServiceCollectionExtensions
Adds OData MCP Server with custom configuration.

Syntax

Parameters

Returns

Type: Microsoft.Extensions.DependencyInjection.IServiceCollection The service collection for chaining.

Exceptions

Examples

Remarks

Registers all core services required for OData MCP functionality with programmatic configuration. This overload is useful when configuration needs to be built dynamically or when not using IConfiguration.