IConverter Interface
Defines methods for converting values between types.
public interface IConverterMethods
| Name | Description |
|---|---|
| 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
inputobject?- The value to convert.
conversionTypeType- The type to convert to.
providerIFormatProvider?- An object that provides culture-specific formatting information.
valueobject?- 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.