Click or drag to resize

JavaScriptExtensionsToPromiseT Method (TaskT, ScriptEngine)

Namespace:  Microsoft.ClearScript.JavaScript
Assembly:  ClearScript.Core (in ClearScript.Core.dll) Version: 7.2.3
Syntax
public static Object ToPromise<T>(
	this Task<T> task,
	ScriptEngine engine
)

Parameters

task
Type: System.Threading.TasksTaskT
The task to convert to a promise.
engine
Type: Microsoft.ClearScriptScriptEngine
The script engine in which the promise will be used.

Type Parameters

T
The task's result type.

Return Value

Type: Object
A promise that represents the task's asynchronous operation.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type TaskT. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
See Also