Skip to main content

Definition

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

Syntax

Summary

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

Remarks

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

Methods

BindWithJsonNames Extension

Extension method from Microsoft.Extensions.Configuration.IConfigurationExtensions
Binds the configuration values to the specified instance using JSON property names for key mapping. This method respects JsonPropertyNameAttribute when determining configuration keys, allowing for JSON-style configuration binding with different property naming conventions.

Syntax

Parameters

Type Parameters

  • T - The type of the instance to bind the configuration values to.

Examples

Remarks

This method supports automatic type conversion for common types including DateTime, DateTimeOffset, and all types supported by Type). If a property has a JsonPropertyNameAttribute, the attribute’s Name value is used as the configuration key; otherwise, the property name is used directly.