JavaScriptExtensionsToPromise Method (Task) |
Converts a
Task instance to a
promise
for use with script code currently running on the calling thread.
Namespace:
Microsoft.ClearScript.JavaScript
Assembly:
ClearScript.Core (in ClearScript.Core.dll) Version: 7.3.1
Syntaxpublic static Object ToPromise(
this Task task
)
<ExtensionAttribute>
Public Shared Function ToPromise (
task As Task
) As Object
public:
[ExtensionAttribute]
static Object^ ToPromise(
Task^ task
)
[<ExtensionAttribute>]
static member ToPromise :
task : Task -> Object
Parameters
- task
- Type: System.Threading.TasksTask
The task to convert to a promise.
Return Value
Type:
ObjectA 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
Task. 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