DevForce Help Reference
Contains<TSource>(IEntityScalarQuery<TSource>,TSource,CancellationToken) Method
Example 


Determines whether a sequence contains any elements that match the specified element. Pass in a System.Threading.CancellationToken to cancel operation.
Syntax
'Declaration
 
<ExtensionAttribute()>
Public Overloads Shared Function Contains(Of TSource)( _
   ByVal source As IEntityScalarQuery(Of TSource), _
   ByVal item As TSource, _
   ByVal cancellationToken As CancellationToken _
) As Task(Of Boolean)
'Usage
 
Dim source As IEntityScalarQuery(Of TSource)
Dim item As TSource
Dim cancellationToken As CancellationToken
Dim value As Task(Of Boolean)
 
value = EntityScalarAsyncExtensions.Contains(Of TSource)(source, item, cancellationToken)

Parameters

source
item
cancellationToken

Type Parameters

TSource
Example
public async void AsyncAny() {
  bool anyEmps = await _entityManager.Employees.AsScalarAsync().Any();
}
Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also

Reference

EntityScalarAsyncExtensions Class
EntityScalarAsyncExtensions Members
Overload List

Send Feedback