T
The type of the result value.
Cocktail Help Reference
FromError<T> Method
See Also  Send Feedback
Cocktail Assembly > Cocktail Namespace > OperationResult Class : FromError<T> Method



error
The exception to store into the failed OperationResult.

Glossary Item Box

Creates a failed OperationResult<T> with the specified error.

Syntax

Visual Basic (Declaration) 
Public Shared Function FromError(Of T)( _
   ByVal error As Exception _
) As OperationResult(Of T)
Visual Basic (Usage)Copy Code
Dim error As Exception
Dim value As OperationResult(Of T)
 
value = OperationResult.FromError(Of T)(error)
C# 
public static OperationResult<T> FromError<T>( 
   Exception error
)
C++/CLI 
public:
static OperationResult<T^>^ FromErrorgeneric<typename T>
( 
   Exception^ error
) 

Parameters

error
The exception to store into the failed OperationResult.

Type Parameters

T
The type of the result value.

Return Value

A failed OperationResult.

Requirements

Target Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, Windows Vista, Windows Server 2008 family

See Also

© 2012 All Rights Reserved.