Skip to content

Commit 77ef004

Browse files
authored
Update async Dispose and methods references (#22407)
* Update async Dispose and methods references - `Dispose` can be changed to `DisposeAsync` - The methods in the following code snippet are not available, it causes duplicate references ``` /// <summary> /// <see cref="HelperResult.WriteTo(TextWriter)"/> is invoked /// </summary> /// <param name="result">The <see cref="HelperResult"/> to invoke</param> protected void Write(HelperResult result) { Write(result); } ``` * Update BaseView.cs
1 parent 381ac51 commit 77ef004

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/Shared/RazorViews/BaseView.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ public async Task ExecuteAsync(Stream stream)
6969
Output = new StreamWriter(buffer, UTF8NoBOM, 4096, leaveOpen: true);
7070
await ExecuteAsync();
7171
await Output.FlushAsync();
72-
Output.Dispose();
72+
await Output.DisposeAsync();
7373
buffer.Seek(0, SeekOrigin.Begin);
7474
await buffer.CopyToAsync(stream);
7575
}
@@ -87,7 +87,7 @@ public async Task ExecuteAsync(HttpContext context)
8787
Output = new StreamWriter(buffer, UTF8NoBOM, 4096, leaveOpen: true);
8888
await ExecuteAsync();
8989
await Output.FlushAsync();
90-
Output.Dispose();
90+
await Output.DisposeAsync();
9191
buffer.Seek(0, SeekOrigin.Begin);
9292
await buffer.CopyToAsync(Response.Body);
9393
}
@@ -244,13 +244,13 @@ protected void WriteAttribute(
244244
WriteLiteral(trailer);
245245
}
246246

247-
/// <summary>
247+
/// <summary>
248248
/// <see cref="HelperResult.WriteTo(TextWriter)"/> is invoked
249249
/// </summary>
250250
/// <param name="result">The <see cref="HelperResult"/> to invoke</param>
251251
protected void Write(HelperResult result)
252252
{
253-
Write(result);
253+
result.WriteTo(Output);
254254
}
255255

256256
/// <summary>

0 commit comments

Comments
 (0)