diff --git a/src/Microsoft.AspNet.Razor/Generator/Compiler/CodeBuilder/CSharp/CSharpTagHelperCodeRenderer.cs b/src/Microsoft.AspNet.Razor/Generator/Compiler/CodeBuilder/CSharp/CSharpTagHelperCodeRenderer.cs index 4af3f2bd0c..ad9b586f03 100644 --- a/src/Microsoft.AspNet.Razor/Generator/Compiler/CodeBuilder/CSharp/CSharpTagHelperCodeRenderer.cs +++ b/src/Microsoft.AspNet.Razor/Generator/Compiler/CodeBuilder/CSharp/CSharpTagHelperCodeRenderer.cs @@ -361,6 +361,8 @@ namespace Microsoft.AspNet.Razor.Generator.Compiler.CSharp private void RenderWriteTagHelperMethodCall() { + _writer.Write("await "); + if (!string.IsNullOrEmpty(_context.TargetWriterName)) { _writer @@ -375,8 +377,7 @@ namespace Microsoft.AspNet.Razor.Generator.Compiler.CSharp _writer .Write(ExecutionContextVariableName) - .WriteEndMethodInvocation(endLine: false) - .WriteLine(".Wait();"); + .WriteEndMethodInvocation(); } private void RenderRunTagHelpers() @@ -384,12 +385,12 @@ namespace Microsoft.AspNet.Razor.Generator.Compiler.CSharp _writer.Write(ExecutionContextVariableName) .Write(".") .WriteStartAssignment(_tagHelperContext.ExecutionContextOutputPropertyName) + .Write("await ") .WriteStartInstanceMethodInvocation(RunnerVariableName, _tagHelperContext.RunnerRunAsyncMethodName); _writer.Write(ExecutionContextVariableName) - .WriteEndMethodInvocation(endLine: false) - .WriteLine(".Result;"); + .WriteEndMethodInvocation(); } private void RenderBufferedAttributeValue(TagHelperAttributeDescriptor attributeDescriptor) diff --git a/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/CS/Output/BasicTagHelpers.CustomAttributeCodeGenerator.cs b/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/CS/Output/BasicTagHelpers.CustomAttributeCodeGenerator.cs index 41d1f138c8..057fb25e16 100644 --- a/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/CS/Output/BasicTagHelpers.CustomAttributeCodeGenerator.cs +++ b/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/CS/Output/BasicTagHelpers.CustomAttributeCodeGenerator.cs @@ -35,8 +35,8 @@ namespace TestOutput , StartTagHelperWritingScope, EndTagHelperWritingScope); __PTagHelper = CreateTagHelper(); __tagHelperExecutionContext.Add(__PTagHelper); - __tagHelperExecutionContext.Output = __tagHelperRunner.RunAsync(__tagHelperExecutionContext).Result; - WriteTagHelperAsync(__tagHelperExecutionContext).Wait(); + __tagHelperExecutionContext.Output = await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); + await WriteTagHelperAsync(__tagHelperExecutionContext); __tagHelperExecutionContext = __tagHelperScopeManager.End(); WriteLiteral("\r\n "); __tagHelperExecutionContext = __tagHelperScopeManager.Begin("input", true, "test", async() => { @@ -49,8 +49,8 @@ namespace TestOutput __InputTagHelper2 = CreateTagHelper(); __tagHelperExecutionContext.Add(__InputTagHelper2); __InputTagHelper2.Type = __InputTagHelper.Type; - __tagHelperExecutionContext.Output = __tagHelperRunner.RunAsync(__tagHelperExecutionContext).Result; - WriteTagHelperAsync(__tagHelperExecutionContext).Wait(); + __tagHelperExecutionContext.Output = await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); + await WriteTagHelperAsync(__tagHelperExecutionContext); __tagHelperExecutionContext = __tagHelperScopeManager.End(); WriteLiteral("\r\n "); __tagHelperExecutionContext = __tagHelperScopeManager.Begin("input", true, "test", async() => { @@ -69,8 +69,8 @@ namespace TestOutput #line default #line hidden __tagHelperExecutionContext.AddTagHelperAttribute("checked", __InputTagHelper2.Checked); - __tagHelperExecutionContext.Output = __tagHelperRunner.RunAsync(__tagHelperExecutionContext).Result; - WriteTagHelperAsync(__tagHelperExecutionContext).Wait(); + __tagHelperExecutionContext.Output = await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); + await WriteTagHelperAsync(__tagHelperExecutionContext); __tagHelperExecutionContext = __tagHelperScopeManager.End(); WriteLiteral("\r\n "); } @@ -78,8 +78,8 @@ namespace TestOutput __PTagHelper = CreateTagHelper(); __tagHelperExecutionContext.Add(__PTagHelper); __tagHelperExecutionContext.AddHtmlAttribute("class", "Hello World"); - __tagHelperExecutionContext.Output = __tagHelperRunner.RunAsync(__tagHelperExecutionContext).Result; - WriteTagHelperAsync(__tagHelperExecutionContext).Wait(); + __tagHelperExecutionContext.Output = await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); + await WriteTagHelperAsync(__tagHelperExecutionContext); __tagHelperExecutionContext = __tagHelperScopeManager.End(); Instrumentation.BeginContext(212, 8, true); WriteLiteral("\r\n"); diff --git a/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/CS/Output/BasicTagHelpers.Prefixed.cs b/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/CS/Output/BasicTagHelpers.Prefixed.cs index 402e864d64..d77c71e661 100644 --- a/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/CS/Output/BasicTagHelpers.Prefixed.cs +++ b/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/CS/Output/BasicTagHelpers.Prefixed.cs @@ -47,8 +47,8 @@ namespace TestOutput #line default #line hidden __tagHelperExecutionContext.AddTagHelperAttribute("checked", __InputTagHelper2.Checked); - __tagHelperExecutionContext.Output = __tagHelperRunner.RunAsync(__tagHelperExecutionContext).Result; - WriteTagHelperAsync(__tagHelperExecutionContext).Wait(); + __tagHelperExecutionContext.Output = await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); + await WriteTagHelperAsync(__tagHelperExecutionContext); __tagHelperExecutionContext = __tagHelperScopeManager.End(); WriteLiteral("\r\n "); } @@ -56,8 +56,8 @@ namespace TestOutput __PTagHelper = CreateTagHelper(); __tagHelperExecutionContext.Add(__PTagHelper); __tagHelperExecutionContext.AddHtmlAttribute("class", "Hello World"); - __tagHelperExecutionContext.Output = __tagHelperRunner.RunAsync(__tagHelperExecutionContext).Result; - WriteTagHelperAsync(__tagHelperExecutionContext).Wait(); + __tagHelperExecutionContext.Output = await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); + await WriteTagHelperAsync(__tagHelperExecutionContext); __tagHelperExecutionContext = __tagHelperScopeManager.End(); Instrumentation.BeginContext(249, 11, true); WriteLiteral("\r\n"); diff --git a/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/CS/Output/BasicTagHelpers.cs b/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/CS/Output/BasicTagHelpers.cs index 18527be872..6f6d894378 100644 --- a/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/CS/Output/BasicTagHelpers.cs +++ b/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/CS/Output/BasicTagHelpers.cs @@ -36,8 +36,8 @@ namespace TestOutput , StartTagHelperWritingScope, EndTagHelperWritingScope); __PTagHelper = CreateTagHelper(); __tagHelperExecutionContext.Add(__PTagHelper); - __tagHelperExecutionContext.Output = __tagHelperRunner.RunAsync(__tagHelperExecutionContext).Result; - WriteTagHelperAsync(__tagHelperExecutionContext).Wait(); + __tagHelperExecutionContext.Output = await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); + await WriteTagHelperAsync(__tagHelperExecutionContext); __tagHelperExecutionContext = __tagHelperScopeManager.End(); WriteLiteral("\r\n "); __tagHelperExecutionContext = __tagHelperScopeManager.Begin("input", true, "test", async() => { @@ -50,8 +50,8 @@ namespace TestOutput __InputTagHelper2 = CreateTagHelper(); __tagHelperExecutionContext.Add(__InputTagHelper2); __InputTagHelper2.Type = __InputTagHelper.Type; - __tagHelperExecutionContext.Output = __tagHelperRunner.RunAsync(__tagHelperExecutionContext).Result; - WriteTagHelperAsync(__tagHelperExecutionContext).Wait(); + __tagHelperExecutionContext.Output = await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); + await WriteTagHelperAsync(__tagHelperExecutionContext); __tagHelperExecutionContext = __tagHelperScopeManager.End(); WriteLiteral("\r\n "); __tagHelperExecutionContext = __tagHelperScopeManager.Begin("input", true, "test", async() => { @@ -70,8 +70,8 @@ namespace TestOutput #line default #line hidden __tagHelperExecutionContext.AddTagHelperAttribute("checked", __InputTagHelper2.Checked); - __tagHelperExecutionContext.Output = __tagHelperRunner.RunAsync(__tagHelperExecutionContext).Result; - WriteTagHelperAsync(__tagHelperExecutionContext).Wait(); + __tagHelperExecutionContext.Output = await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); + await WriteTagHelperAsync(__tagHelperExecutionContext); __tagHelperExecutionContext = __tagHelperScopeManager.End(); WriteLiteral("\r\n "); } @@ -79,8 +79,8 @@ namespace TestOutput __PTagHelper = CreateTagHelper(); __tagHelperExecutionContext.Add(__PTagHelper); __tagHelperExecutionContext.AddHtmlAttribute("class", "Hello World"); - __tagHelperExecutionContext.Output = __tagHelperRunner.RunAsync(__tagHelperExecutionContext).Result; - WriteTagHelperAsync(__tagHelperExecutionContext).Wait(); + __tagHelperExecutionContext.Output = await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); + await WriteTagHelperAsync(__tagHelperExecutionContext); __tagHelperExecutionContext = __tagHelperScopeManager.End(); Instrumentation.BeginContext(212, 8, true); WriteLiteral("\r\n"); diff --git a/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/CS/Output/ComplexTagHelpers.cs b/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/CS/Output/ComplexTagHelpers.cs index ad6f6f7ce4..a3eb7987ae 100644 --- a/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/CS/Output/ComplexTagHelpers.cs +++ b/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/CS/Output/ComplexTagHelpers.cs @@ -71,15 +71,15 @@ namespace TestOutput __InputTagHelper2.Type = __InputTagHelper.Type; __tagHelperExecutionContext.AddHtmlAttribute("value", ""); __tagHelperExecutionContext.AddHtmlAttribute("placeholder", "Enter in a new time..."); - __tagHelperExecutionContext.Output = __tagHelperRunner.RunAsync(__tagHelperExecutionContext).Result; - WriteTagHelperAsync(__tagHelperExecutionContext).Wait(); + __tagHelperExecutionContext.Output = await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); + await WriteTagHelperAsync(__tagHelperExecutionContext); __tagHelperExecutionContext = __tagHelperScopeManager.End(); } , StartTagHelperWritingScope, EndTagHelperWritingScope); __PTagHelper = CreateTagHelper(); __tagHelperExecutionContext.Add(__PTagHelper); - __tagHelperExecutionContext.Output = __tagHelperRunner.RunAsync(__tagHelperExecutionContext).Result; - WriteTagHelperAsync(__tagHelperExecutionContext).Wait(); + __tagHelperExecutionContext.Output = await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); + await WriteTagHelperAsync(__tagHelperExecutionContext); __tagHelperExecutionContext = __tagHelperScopeManager.End(); WriteLiteral("\r\n"); #line 13 "ComplexTagHelpers.cshtml" @@ -116,15 +116,15 @@ Write(checkbox); #line default #line hidden __tagHelperExecutionContext.AddTagHelperAttribute("checked", __InputTagHelper2.Checked); - __tagHelperExecutionContext.Output = __tagHelperRunner.RunAsync(__tagHelperExecutionContext).Result; - WriteTagHelperAsync(__tagHelperExecutionContext).Wait(); + __tagHelperExecutionContext.Output = await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); + await WriteTagHelperAsync(__tagHelperExecutionContext); __tagHelperExecutionContext = __tagHelperScopeManager.End(); } , StartTagHelperWritingScope, EndTagHelperWritingScope); __PTagHelper = CreateTagHelper(); __tagHelperExecutionContext.Add(__PTagHelper); - __tagHelperExecutionContext.Output = __tagHelperRunner.RunAsync(__tagHelperExecutionContext).Result; - WriteTagHelperAsync(__tagHelperExecutionContext).Wait(); + __tagHelperExecutionContext.Output = await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); + await WriteTagHelperAsync(__tagHelperExecutionContext); __tagHelperExecutionContext = __tagHelperScopeManager.End(); WriteLiteral("\r\n "); __tagHelperExecutionContext = __tagHelperScopeManager.Begin("input", true, "test", async() => { @@ -144,8 +144,8 @@ Write(true ? "checkbox" : "anything"); __InputTagHelper2 = CreateTagHelper(); __tagHelperExecutionContext.Add(__InputTagHelper2); __InputTagHelper2.Type = __InputTagHelper.Type; - __tagHelperExecutionContext.Output = __tagHelperRunner.RunAsync(__tagHelperExecutionContext).Result; - WriteTagHelperAsync(__tagHelperExecutionContext).Wait(); + __tagHelperExecutionContext.Output = await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); + await WriteTagHelperAsync(__tagHelperExecutionContext); __tagHelperExecutionContext = __tagHelperScopeManager.End(); WriteLiteral("\r\n "); __tagHelperExecutionContext = __tagHelperScopeManager.Begin("input", true, "test", async() => { @@ -180,8 +180,8 @@ if(true) { __InputTagHelper2 = CreateTagHelper(); __tagHelperExecutionContext.Add(__InputTagHelper2); __InputTagHelper2.Type = __InputTagHelper.Type; - __tagHelperExecutionContext.Output = __tagHelperRunner.RunAsync(__tagHelperExecutionContext).Result; - WriteTagHelperAsync(__tagHelperExecutionContext).Wait(); + __tagHelperExecutionContext.Output = await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); + await WriteTagHelperAsync(__tagHelperExecutionContext); __tagHelperExecutionContext = __tagHelperScopeManager.End(); WriteLiteral("\r\n"); #line 19 "ComplexTagHelpers.cshtml" @@ -204,8 +204,8 @@ Write(DateTime.Now); #line hidden __tagHelperStringValueBuffer = EndTagHelperWritingScope(); __tagHelperExecutionContext.AddHtmlAttribute("time", __tagHelperStringValueBuffer.ToString()); - __tagHelperExecutionContext.Output = __tagHelperRunner.RunAsync(__tagHelperExecutionContext).Result; - WriteTagHelperAsync(__tagHelperExecutionContext).Wait(); + __tagHelperExecutionContext.Output = await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); + await WriteTagHelperAsync(__tagHelperExecutionContext); __tagHelperExecutionContext = __tagHelperScopeManager.End(); Instrumentation.BeginContext(672, 10, true); WriteLiteral("\r\n "); @@ -238,8 +238,8 @@ __InputTagHelper2.Checked = @object; #line default #line hidden __tagHelperExecutionContext.AddTagHelperAttribute("checked", __InputTagHelper2.Checked); - __tagHelperExecutionContext.Output = __tagHelperRunner.RunAsync(__tagHelperExecutionContext).Result; - WriteTagHelperAsync(__tagHelperExecutionContext).Wait(); + __tagHelperExecutionContext.Output = await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); + await WriteTagHelperAsync(__tagHelperExecutionContext); __tagHelperExecutionContext = __tagHelperScopeManager.End(); WriteLiteral("\r\n "); } @@ -252,8 +252,8 @@ __PTagHelper.Age = DateTimeOffset.Now.Year - 1970; #line default #line hidden __tagHelperExecutionContext.AddTagHelperAttribute("age", __PTagHelper.Age); - __tagHelperExecutionContext.Output = __tagHelperRunner.RunAsync(__tagHelperExecutionContext).Result; - WriteTagHelperAsync(__tagHelperExecutionContext).Wait(); + __tagHelperExecutionContext.Output = await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); + await WriteTagHelperAsync(__tagHelperExecutionContext); __tagHelperExecutionContext = __tagHelperScopeManager.End(); Instrumentation.BeginContext(819, 10, true); WriteLiteral("\r\n "); @@ -273,8 +273,8 @@ __InputTagHelper2.Checked = DateTimeOffset.Now.Year > 2014; #line default #line hidden __tagHelperExecutionContext.AddTagHelperAttribute("checked", __InputTagHelper2.Checked); - __tagHelperExecutionContext.Output = __tagHelperRunner.RunAsync(__tagHelperExecutionContext).Result; - WriteTagHelperAsync(__tagHelperExecutionContext).Wait(); + __tagHelperExecutionContext.Output = await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); + await WriteTagHelperAsync(__tagHelperExecutionContext); __tagHelperExecutionContext = __tagHelperScopeManager.End(); WriteLiteral("\r\n "); } @@ -287,8 +287,8 @@ __PTagHelper.Age = -1970 + DateTimeOffset.Now.Year; #line default #line hidden __tagHelperExecutionContext.AddTagHelperAttribute("age", __PTagHelper.Age); - __tagHelperExecutionContext.Output = __tagHelperRunner.RunAsync(__tagHelperExecutionContext).Result; - WriteTagHelperAsync(__tagHelperExecutionContext).Wait(); + __tagHelperExecutionContext.Output = await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); + await WriteTagHelperAsync(__tagHelperExecutionContext); __tagHelperExecutionContext = __tagHelperScopeManager.End(); Instrumentation.BeginContext(952, 10, true); WriteLiteral("\r\n "); @@ -308,8 +308,8 @@ __InputTagHelper2.Checked = DateTimeOffset.Now.Year > 2014; #line default #line hidden __tagHelperExecutionContext.AddTagHelperAttribute("checked", __InputTagHelper2.Checked); - __tagHelperExecutionContext.Output = __tagHelperRunner.RunAsync(__tagHelperExecutionContext).Result; - WriteTagHelperAsync(__tagHelperExecutionContext).Wait(); + __tagHelperExecutionContext.Output = await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); + await WriteTagHelperAsync(__tagHelperExecutionContext); __tagHelperExecutionContext = __tagHelperScopeManager.End(); WriteLiteral("\r\n "); } @@ -322,8 +322,8 @@ __PTagHelper.Age = DateTimeOffset.Now.Year - 1970; #line default #line hidden __tagHelperExecutionContext.AddTagHelperAttribute("age", __PTagHelper.Age); - __tagHelperExecutionContext.Output = __tagHelperRunner.RunAsync(__tagHelperExecutionContext).Result; - WriteTagHelperAsync(__tagHelperExecutionContext).Wait(); + __tagHelperExecutionContext.Output = await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); + await WriteTagHelperAsync(__tagHelperExecutionContext); __tagHelperExecutionContext = __tagHelperScopeManager.End(); Instrumentation.BeginContext(1080, 10, true); WriteLiteral("\r\n "); @@ -343,8 +343,8 @@ __InputTagHelper2.Checked = DateTimeOffset.Now.Year > 2014 ; #line default #line hidden __tagHelperExecutionContext.AddTagHelperAttribute("checked", __InputTagHelper2.Checked); - __tagHelperExecutionContext.Output = __tagHelperRunner.RunAsync(__tagHelperExecutionContext).Result; - WriteTagHelperAsync(__tagHelperExecutionContext).Wait(); + __tagHelperExecutionContext.Output = await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); + await WriteTagHelperAsync(__tagHelperExecutionContext); __tagHelperExecutionContext = __tagHelperScopeManager.End(); WriteLiteral("\r\n "); } @@ -357,8 +357,8 @@ __PTagHelper.Age = "My age is this long.".Length; #line default #line hidden __tagHelperExecutionContext.AddTagHelperAttribute("age", __PTagHelper.Age); - __tagHelperExecutionContext.Output = __tagHelperRunner.RunAsync(__tagHelperExecutionContext).Result; - WriteTagHelperAsync(__tagHelperExecutionContext).Wait(); + __tagHelperExecutionContext.Output = await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); + await WriteTagHelperAsync(__tagHelperExecutionContext); __tagHelperExecutionContext = __tagHelperScopeManager.End(); Instrumentation.BeginContext(1223, 14, true); WriteLiteral("\r\n \r\n"); diff --git a/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/CS/Output/EmptyAttributeTagHelpers.cs b/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/CS/Output/EmptyAttributeTagHelpers.cs index b1036b8f6b..feb843a32b 100644 --- a/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/CS/Output/EmptyAttributeTagHelpers.cs +++ b/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/CS/Output/EmptyAttributeTagHelpers.cs @@ -46,8 +46,8 @@ __InputTagHelper2.Checked = ; #line hidden __tagHelperExecutionContext.AddTagHelperAttribute("checked", __InputTagHelper2.Checked); __tagHelperExecutionContext.AddHtmlAttribute("class", ""); - __tagHelperExecutionContext.Output = __tagHelperRunner.RunAsync(__tagHelperExecutionContext).Result; - WriteTagHelperAsync(__tagHelperExecutionContext).Wait(); + __tagHelperExecutionContext.Output = await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); + await WriteTagHelperAsync(__tagHelperExecutionContext); __tagHelperExecutionContext = __tagHelperScopeManager.End(); Instrumentation.BeginContext(74, 6, true); WriteLiteral("\r\n "); @@ -71,8 +71,8 @@ __InputTagHelper2.Checked = ; #line hidden __tagHelperExecutionContext.AddTagHelperAttribute("checked", __InputTagHelper2.Checked); __tagHelperExecutionContext.AddHtmlAttribute("class", ""); - __tagHelperExecutionContext.Output = __tagHelperRunner.RunAsync(__tagHelperExecutionContext).Result; - WriteTagHelperAsync(__tagHelperExecutionContext).Wait(); + __tagHelperExecutionContext.Output = await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); + await WriteTagHelperAsync(__tagHelperExecutionContext); __tagHelperExecutionContext = __tagHelperScopeManager.End(); WriteLiteral("\r\n "); } @@ -85,8 +85,8 @@ __PTagHelper.Age = ; #line default #line hidden __tagHelperExecutionContext.AddTagHelperAttribute("age", __PTagHelper.Age); - __tagHelperExecutionContext.Output = __tagHelperRunner.RunAsync(__tagHelperExecutionContext).Result; - WriteTagHelperAsync(__tagHelperExecutionContext).Wait(); + __tagHelperExecutionContext.Output = await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); + await WriteTagHelperAsync(__tagHelperExecutionContext); __tagHelperExecutionContext = __tagHelperScopeManager.End(); Instrumentation.BeginContext(144, 8, true); WriteLiteral("\r\n"); diff --git a/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/CS/Output/EscapedTagHelpers.cs b/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/CS/Output/EscapedTagHelpers.cs index 033450f381..f6521c60f7 100644 --- a/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/CS/Output/EscapedTagHelpers.cs +++ b/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/CS/Output/EscapedTagHelpers.cs @@ -61,8 +61,8 @@ Write(DateTime.Now); #line default #line hidden __tagHelperExecutionContext.AddTagHelperAttribute("checked", __InputTagHelper2.Checked); - __tagHelperExecutionContext.Output = __tagHelperRunner.RunAsync(__tagHelperExecutionContext).Result; - WriteTagHelperAsync(__tagHelperExecutionContext).Wait(); + __tagHelperExecutionContext.Output = await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); + await WriteTagHelperAsync(__tagHelperExecutionContext); __tagHelperExecutionContext = __tagHelperScopeManager.End(); Instrumentation.BeginContext(231, 18, true); WriteLiteral("\r\n

\r\n"); diff --git a/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/CS/Output/SingleTagHelper.cs b/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/CS/Output/SingleTagHelper.cs index f17063a6aa..5c9e26f0a9 100644 --- a/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/CS/Output/SingleTagHelper.cs +++ b/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/CS/Output/SingleTagHelper.cs @@ -40,8 +40,8 @@ namespace TestOutput #line hidden __tagHelperExecutionContext.AddTagHelperAttribute("age", __PTagHelper.Age); __tagHelperExecutionContext.AddHtmlAttribute("class", "Hello World"); - __tagHelperExecutionContext.Output = __tagHelperRunner.RunAsync(__tagHelperExecutionContext).Result; - WriteTagHelperAsync(__tagHelperExecutionContext).Wait(); + __tagHelperExecutionContext.Output = await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); + await WriteTagHelperAsync(__tagHelperExecutionContext); __tagHelperExecutionContext = __tagHelperScopeManager.End(); } #pragma warning restore 1998 diff --git a/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/CS/Output/TagHelpersInSection.cs b/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/CS/Output/TagHelpersInSection.cs index 4ed70ec2c7..cc1958e9ec 100644 --- a/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/CS/Output/TagHelpersInSection.cs +++ b/test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/CS/Output/TagHelpersInSection.cs @@ -53,8 +53,8 @@ namespace TestOutput , StartTagHelperWritingScope, EndTagHelperWritingScope); __NestedTagHelper = CreateTagHelper(); __tagHelperExecutionContext.Add(__NestedTagHelper); - __tagHelperExecutionContext.Output = __tagHelperRunner.RunAsync(__tagHelperExecutionContext).Result; - WriteTagHelperAsync(__tagHelperExecutionContext).Wait(); + __tagHelperExecutionContext.Output = await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); + await WriteTagHelperAsync(__tagHelperExecutionContext); __tagHelperExecutionContext = __tagHelperScopeManager.End(); WriteLiteral("\r\n "); } @@ -80,8 +80,8 @@ Write(DateTime.Now); #line hidden __tagHelperStringValueBuffer = EndTagHelperWritingScope(); __tagHelperExecutionContext.AddHtmlAttribute("unboundproperty", __tagHelperStringValueBuffer.ToString()); - __tagHelperExecutionContext.Output = __tagHelperRunner.RunAsync(__tagHelperExecutionContext).Result; - WriteTagHelperToAsync(__razor_template_writer, __tagHelperExecutionContext).Wait(); + __tagHelperExecutionContext.Output = await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); + await WriteTagHelperToAsync(__razor_template_writer, __tagHelperExecutionContext); __tagHelperExecutionContext = __tagHelperScopeManager.End(); Instrumentation.BeginContext(359, 14, true); WriteLiteralTo(__razor_template_writer, "\r\n \r\n");