| AsyncHelperNullGuardTResult Method (TaskTResult) |
Insures that an awaited method always returns a
Task.
Namespace:
Cauldron
Assembly:
Cauldron.Win32.WPF (in Cauldron.Win32.WPF.dll) Version: 3.2.0.1 (3.2.0.1)
Syntax public static Task<TResult> NullGuard<TResult>(
Task<TResult> task
)
Parameters
- task
- Type: System.Threading.TasksTaskTResult
The awaitable task
Type Parameters
- TResult
- The type of the result produced by TaskTResult.
Return Value
Type:
TaskTResultAn awaitable task
Exceptions Examples var value = await AsyncHelper.NullGuard(instance.GetStuff()?.GetAllValuesAsync());
See Also