Try |
public class TryCastWorker<TValue, TResult> : TryCastWorkerBase<TValue, TResult> where TValue : class
The TryCastWorkerTValue, TResult type exposes the following members.
Name | Description | |
---|---|---|
InternalResult |
Gets the result of the action of the first succeeded cast.
(Inherited from TryCastWorkerBaseTValue, TResult) | |
Result | Gets the result of the action of the first succeeded cast. | |
Value |
Gets the value to cast.
(Inherited from TryCastWorkerBaseTValue, TResult) |
Name | Description | |
---|---|---|
Else | Executes the action and returns the result if no previous cast has succeeded. | |
ElseThrow |
Throws an InvalidOperationException if none of the casts have succeeded.
(Inherited from TryCastWorkerBaseTValue, TResult) | |
ElseThrow(String) |
Throws an InvalidOperationException if none of the casts have succeeded.
(Inherited from TryCastWorkerBaseTValue, TResult) | |
TryExecuteTTarget |
Tries to cast the value and executes the action if the cast was successful.
(Inherited from TryCastWorkerBaseTValue, TResult) | |
WhenTTarget | Tries to cast the value to TTarget; if the cast succeeds, the action is executed and the result is stored in the Result property. |
Name | Description | |
---|---|---|
SafeCastT |
Performs a cast from object to T, avoiding possible null violations if T is a value type.
(Defined by ObjectExtensions) |