Compartilhar via


TplExtensions.Forget Method

Consumes a task and doesn't do anything with it. Useful for fire-and-forget calls to asynchronous methods within asynchronous methods.

Namespace:  Microsoft.VisualStudio.Threading
Assembly:  Microsoft.VisualStudio.Threading (in Microsoft.VisualStudio.Threading.dll)

Syntax

'Declaration
<ExtensionAttribute> _
Public Shared Sub Forget ( _
    task As Task _
)
public static void Forget(
    this Task task
)
[ExtensionAttribute]
public:
static void Forget(
    Task^ task
)
static member Forget : 
        task:Task -> unit
public static function Forget(
    task : Task
)

Parameters

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).

.NET Framework Security

See Also

Reference

TplExtensions Class

Microsoft.VisualStudio.Threading Namespace