IConverter Interface

Defines methods for converting values between types.

public interface IConverter

Methods

NameDescription
TryChangeType(object?, Type, IFormatProvider?, object?)Attempts to convert an input value to a specified type.

TryChangeType(object?, Type, IFormatProvider?, object?)

Attempts to convert an input value to a specified type.

bool TryChangeType(object? input, Type conversionType, IFormatProvider? provider, out object? value)

Parameters

input object?
The value to convert.
conversionType Type
The type to convert to.
provider IFormatProvider?
An object that provides culture-specific formatting information.
value object?
When this method returns, contains the converted value if the conversion succeeded, or null if the conversion failed.

Returns

bool true if the conversion succeeded; otherwise, false.