A Sandcastle Documented Class Library

# CallerContextService SpawnTask TResult Method

Creates an asynchronous task which inherits the properties of the current caller context.

Namespace: Dundas.BI.Services
Assembly: Dundas.BI.Core (in Dundas.BI.Core.dll) Version: 2.0.0.0 (10.0.0.1002)
Syntax
C#
VB
C++
F#
Copy

    public Task<TResult> SpawnTask<TResult>(
    	string name,
    	Func<TResult> func,
    	GroupCancellationToken cancellationToken
    )

    Public Function SpawnTask(Of TResult) (
    	name As String,
    	func As Func(Of TResult),
    	cancellationToken As GroupCancellationToken
    ) As Task(Of TResult)

    public:
    generic<typename TResult>
    virtual Task<TResult>^ SpawnTask(
    	String^ name,
    	Func<TResult>^ func,
    	GroupCancellationToken^ cancellationToken
    ) sealed

    abstract SpawnTask :
            name : string *
            func : Func<'TResult> *
            cancellationToken : GroupCancellationToken -> Task<'TResult>
    override SpawnTask :
            name : string *
            func : Func<'TResult> *
            cancellationToken : GroupCancellationToken -> Task<'TResult>

#### Parameters

name
  Type: System
  String
  A name which will be assigned to the spawned operation (used for diagnostic purposes).
func
  Type: System
  Func
  TResult
  The function to invoke asynchronously.
cancellationToken
  Type: Dundas.BI.Data.DataRetrieval
  GroupCancellationToken
  The cancellation token.

#### Type Parameters

TResult
  The type of object returned by the task.

#### Return Value

Type: Task
TResult
A task object representing the asynchronous operation.

#### Implements

ICallerContextService
SpawnTask
TResult
(String, Func
TResult
, GroupCancellationToken)
Exceptions

Exception | Condition
--- | ---
ArgumentNullException | func is .

See Also

#### Reference

CallerContextService Class
Dundas.BI.Services Namespace