<PackageReference Include="Newtonsoft.Json" Version="4.0.2" />

ConvertUtils

static class ConvertUtils
public static bool CanConvertType(Type initialType, Type targetType, bool allowTypeNameToString)

public static T Convert<T>(object initialValue)

Converts the value to the specified type.

public static T Convert<T>(object initialValue, CultureInfo culture)

Converts the value to the specified type.

public static object Convert(object initialValue, CultureInfo culture, Type targetType)

Converts the value to the specified type.

public static T ConvertOrCast<T>(object initialValue)

Converts the value to the specified type. If the value is unable to be converted, the value is checked whether it assignable to the specified type.

public static T ConvertOrCast<T>(object initialValue, CultureInfo culture)

Converts the value to the specified type. If the value is unable to be converted, the value is checked whether it assignable to the specified type.

public static object ConvertOrCast(object initialValue, CultureInfo culture, Type targetType)

Converts the value to the specified type. If the value is unable to be converted, the value is checked whether it assignable to the specified type.

public static bool IsInteger(object value)

public static object ToValue(INullable nullableValue)

public static bool TryConvert<T>(object initialValue, out T convertedValue)

Converts the value to the specified type.

public static bool TryConvert<T>(object initialValue, CultureInfo culture, out T convertedValue)

Converts the value to the specified type.

public static bool TryConvert(object initialValue, CultureInfo culture, Type targetType, out object convertedValue)

Converts the value to the specified type.

public static bool TryConvertOrCast<T>(object initialValue, out T convertedValue)

Converts the value to the specified type. If the value is unable to be converted, the value is checked whether it assignable to the specified type.

public static bool TryConvertOrCast<T>(object initialValue, CultureInfo culture, out T convertedValue)

Converts the value to the specified type. If the value is unable to be converted, the value is checked whether it assignable to the specified type.

public static bool TryConvertOrCast(object initialValue, CultureInfo culture, Type targetType, out object convertedValue)

Converts the value to the specified type. If the value is unable to be converted, the value is checked whether it assignable to the specified type.