T
The type of entity queried.
Cocktail Help Reference
OnComplete<T>(EntityScalarQueryOperation<T>,Action<T>,Action<Exception>) Method
See Also  Example Send Feedback
Cocktail.Compat Assembly > Cocktail Namespace > OperationFns Class > OnComplete Method : OnComplete<T>(EntityScalarQueryOperation<T>,Action<T>,Action<Exception>) Method



source
The EntityScalarQueryOperation returned from an asynchronous query.
onSuccess
A callback to be called if the asynchronous query was successful.
onFail
A callback to be called if the asynchronous query failed.

Glossary Item Box

Extension method to process the result of an asynchronous scalar query operation.

Syntax

Visual Basic (Declaration) 
<ExtensionAttribute()>
Public Overloads Shared Function OnComplete(Of T)( _
   ByVal source As IdeaBlade.EntityModel.EntityScalarQueryOperation(Of T), _
   ByVal onSuccess As Action(Of T), _
   ByVal onFail As Action(Of Exception) _
) As IdeaBlade.EntityModel.EntityScalarQueryOperation(Of T)
Visual Basic (Usage)Copy Code
Dim source As IdeaBlade.EntityModel.EntityScalarQueryOperation(Of T)
Dim onSuccess As Action(Of T)
Dim onFail As Action(Of Exception)
Dim value As IdeaBlade.EntityModel.EntityScalarQueryOperation(Of T)
 
value = OperationFns.OnComplete(Of T)(source, onSuccess, onFail)
C# 
[ExtensionAttribute()]
public static IdeaBlade.EntityModel.EntityScalarQueryOperation<T> OnComplete<T>( 
   IdeaBlade.EntityModel.EntityScalarQueryOperation<T> source,
   Action<T> onSuccess,
   Action<Exception> onFail
)
C++/CLI 
[ExtensionAttribute()]
public:
static IdeaBlade.EntityModel.EntityScalarQueryOperation<T^>^ OnCompletegeneric<typename T>
( 
   IdeaBlade.EntityModel.EntityScalarQueryOperation<T^>^ source,
   Action<T^>^ onSuccess,
   Action<Exception^>^ onFail
) 

Parameters

source
The EntityScalarQueryOperation returned from an asynchronous query.
onSuccess
A callback to be called if the asynchronous query was successful.
onFail
A callback to be called if the asynchronous query failed.

Type Parameters

T
The type of entity queried.

Return Value

Returns the EntityScalarQueryOperation passed to the method's source parameter.

Example

C#Copy Code
public OperationResult GetCustomerCount(Action<int> onSuccess = null,
                Action<Exception> onFail = null)
                {
                var op = Manager.Customers.AsScalarAsync().Count();
                return op.OnComplete(onSuccess, onFail).AsOperationResult();
                }

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

© 2013 All Rights Reserved.