Skip to content

Commit 8babbd8

Browse files
Update IAsyncDisposable to mention using statement (#4149)
1 parent cb61a07 commit 8babbd8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

xml/System/IAsyncDisposable.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ The async methods are used in conjunction with the `async` and `await` keywords
3737
3838
### Using an object that implements IAsyncDisposable
3939
40-
If your application uses an object that implements `IAsyncDisposable`, you should call the object's <xref:System.IAsyncDisposable.DisposeAsync%2A> implementation when you are finished using it. To make sure resources are released even in case of an exception, call the <xref:System.IAsyncDisposable.DisposeAsync%2A> method inside a `finally` clause of the `try`/`finally` statement. For more information about the `try`/`finally` pattern, see [try-finally](~/docs/csharp/language-reference/keywords/try-finally.md) (C#) or [Try...Catch...Finally Statement](~/docs/visual-basic/language-reference/statements/try-catch-finally-statement.md) (Visual Basic).
40+
If your application uses an object that implements `IAsyncDisposable`, you should call the object's <xref:System.IAsyncDisposable.DisposeAsync%2A> implementation when you are finished using it. To make sure resources are released even in case of an exception, put the code that uses the `IAsyncDisposable` object into the [using](~/docs/csharp/language-reference/keywords/using.md) statement (in C# beginning from version 8.0) or call the <xref:System.IAsyncDisposable.DisposeAsync%2A> method inside a `finally` clause of the `try`/`finally` statement. For more information about the `try`/`finally` pattern, see [try-finally](~/docs/csharp/language-reference/keywords/try-finally.md) (C#) or [Try...Catch...Finally Statement](~/docs/visual-basic/language-reference/statements/try-catch-finally-statement.md) (Visual Basic).
4141
4242
### Implementing IAsyncDisposable
4343

0 commit comments

Comments
 (0)