From 77ef004db4c0268b99aa719e74b50ff2044d2f3f Mon Sep 17 00:00:00 2001 From: Huei Feng <34702552+hueifeng@users.noreply.github.com> Date: Wed, 3 Jun 2020 23:43:08 +0800 Subject: [PATCH] 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 ``` /// /// is invoked /// /// The to invoke protected void Write(HelperResult result) { Write(result); } ``` * Update BaseView.cs --- src/Shared/RazorViews/BaseView.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Shared/RazorViews/BaseView.cs b/src/Shared/RazorViews/BaseView.cs index 97a089267f..04b112a1c1 100644 --- a/src/Shared/RazorViews/BaseView.cs +++ b/src/Shared/RazorViews/BaseView.cs @@ -69,7 +69,7 @@ namespace Microsoft.Extensions.RazorViews Output = new StreamWriter(buffer, UTF8NoBOM, 4096, leaveOpen: true); await ExecuteAsync(); await Output.FlushAsync(); - Output.Dispose(); + await Output.DisposeAsync(); buffer.Seek(0, SeekOrigin.Begin); await buffer.CopyToAsync(stream); } @@ -87,7 +87,7 @@ namespace Microsoft.Extensions.RazorViews Output = new StreamWriter(buffer, UTF8NoBOM, 4096, leaveOpen: true); await ExecuteAsync(); await Output.FlushAsync(); - Output.Dispose(); + await Output.DisposeAsync(); buffer.Seek(0, SeekOrigin.Begin); await buffer.CopyToAsync(Response.Body); } @@ -244,13 +244,13 @@ namespace Microsoft.Extensions.RazorViews WriteLiteral(trailer); } - /// + /// /// is invoked /// /// The to invoke protected void Write(HelperResult result) { - Write(result); + result.WriteTo(Output); } ///