Cast

Cast(object, Type, ExceptionMode)

public static object Cast(object obj, Type type, ExceptionMode exceptionMode) ;

Description

Cast the object.

Parameters

Parameter Name Description
obj The object to cast
type Casting type
exceptionMode Exception mode
If other than Throw, return default when an exception occurs.

Returns

Casted value

Cast(object, Type, bool)

public static object Cast(object obj, Type type, bool ignoreThrowException) ;

Description

Cast the object.

Parameters

Parameter Name Description
obj The object to cast
type Casting type
ignoreThrowException Flag to ignore exceptions.
If set to true, it will output an exception message to the log and return default when an exception occurs.

Returns

Casted value