From 3c73ae9cfeb141b743b84d9e0a2ff6bbea00ce6d Mon Sep 17 00:00:00 2001 From: "N. Taylor Mullen" Date: Tue, 22 Mar 2016 15:51:28 -0700 Subject: [PATCH] Change `TagHelperOutput` and `TagHelperContext` lifetimes. - `TagHelperOutput` and `TagHelperContext` lifetimes now mach `TagHelperExecutionContext`s. This means once a set of `TagHelper`s have run on a tag the `TagHelperOutput`/`TagHelperContext` will be re-used. - Added tests to validate the various `Reset`/`Reinitialize` methods behaved correctly. - Updated codegen to no longer set `TagHelperExecutionContext.Output`. #719 --- .../TagHelpers/TagHelperExecutionContext.cs | 57 ++++++------------- .../Runtime/TagHelpers/TagHelperRunner.cs | 8 +-- .../TagHelpers/DefaultTagHelperContent.cs | 22 +++++-- .../TagHelpers/TagHelperContent.cs | 7 +++ .../TagHelpers/TagHelperContext.cs | 29 ++++++++-- .../TagHelpers/TagHelperOutput.cs | 51 ++++++++++------- .../CSharpTagHelperCodeRenderer.cs | 14 ++--- .../TagHelperExecutionContextTest.cs | 14 ++--- .../Runtime/TagHelpers/TagHelperRunnerTest.cs | 11 ++-- .../TagHelpers/TagHelperScopeManagerTest.cs | 8 +-- .../TagHelpers/DefaultTagHelperContentTest.cs | 14 +++++ .../TagHelpers/TagHelperContextTest.cs | 29 ++++++++++ .../TagHelpers/TagHelperOutputTest.cs | 49 ++++++++++++++++ .../Output/AttributeTargetingTagHelpers.cs | 8 +-- ...TagHelpers.CustomAttributeCodeGenerator.cs | 8 +-- .../Output/BasicTagHelpers.Prefixed.cs | 4 +- .../CodeGenerator/Output/BasicTagHelpers.cs | 8 +-- .../CodeGenerator/Output/ComplexTagHelpers.cs | 34 +++++------ .../Output/CssSelectorTagHelperAttributes.cs | 20 +++---- .../Output/DuplicateAttributeTagHelpers.cs | 6 +- .../Output/DuplicateTargetTagHelper.cs | 2 +- .../Output/DynamicAttributeTagHelpers.cs | 12 ++-- .../Output/EmptyAttributeTagHelpers.cs | 6 +- .../CodeGenerator/Output/EnumTagHelpers.cs | 10 ++-- .../CodeGenerator/Output/EscapedTagHelpers.cs | 2 +- .../Output/IncompleteTagHelper.cs | 2 +- .../Output/MinimizedTagHelpers.cs | 10 ++-- .../Output/NestedScriptTagTagHelpers.cs | 4 +- .../PrefixedAttributeTagHelpers.Reversed.cs | 8 +-- .../Output/PrefixedAttributeTagHelpers.cs | 8 +-- .../CodeGenerator/Output/SingleTagHelper.cs | 2 +- ...gleTagHelperWithNewlineBeforeAttributes.cs | 2 +- .../Output/SymbolBoundAttributes.cs | 14 ++--- .../Output/TagHelpersInSection.cs | 4 +- .../TagHelpersWithWeirdlySpacedAttributes.cs | 8 +-- .../TransitionsInTagHelperAttributes.cs | 12 ++-- 36 files changed, 310 insertions(+), 197 deletions(-) diff --git a/src/Microsoft.AspNetCore.Razor.Runtime/Runtime/TagHelpers/TagHelperExecutionContext.cs b/src/Microsoft.AspNetCore.Razor.Runtime/Runtime/TagHelpers/TagHelperExecutionContext.cs index 11d13ca088..8923a8bfaa 100644 --- a/src/Microsoft.AspNetCore.Razor.Runtime/Runtime/TagHelpers/TagHelperExecutionContext.cs +++ b/src/Microsoft.AspNetCore.Razor.Runtime/Runtime/TagHelpers/TagHelperExecutionContext.cs @@ -18,12 +18,8 @@ namespace Microsoft.AspNetCore.Razor.Runtime.TagHelpers private readonly Action _startTagHelperWritingScope; private readonly Func _endTagHelperWritingScope; private TagHelperContent _childContent; - private string _tagName; - private string _uniqueId; - private TagMode _tagMode; private Func _executeChildContentAsync; private Dictionary _perEncoderChildContent; - private TagHelperAttributeList _htmlAttributes; private TagHelperAttributeList _allAttributes; /// @@ -74,6 +70,13 @@ namespace Microsoft.AspNetCore.Razor.Runtime.TagHelpers } _tagHelpers = new List(); + _allAttributes = new TagHelperAttributeList(); + + Context = new TagHelperContext(_allAttributes, items, uniqueId); + Output = new TagHelperOutput(tagName, new TagHelperAttributeList(), GetChildContentAsync) + { + TagMode = tagMode + }; Reinitialize(tagName, tagMode, items, uniqueId, executeChildContentAsync); @@ -108,18 +111,16 @@ namespace Microsoft.AspNetCore.Razor.Runtime.TagHelpers } } + // Internal set for testing. /// - /// The s' output. + /// The 's output. /// - public TagHelperOutput Output { get; set; } + public TagHelperOutput Output { get; internal set; } - public TagHelperContext CreateTagHelperContext() => - new TagHelperContext(_allAttributes, Items, _uniqueId); - public TagHelperOutput CreateTagHelperOutput() => - new TagHelperOutput(_tagName, _htmlAttributes, GetChildContentAsync) - { - TagMode = _tagMode - }; + /// + /// The 's context. + /// + public TagHelperContext Context { get; } /// /// Tracks the given . @@ -177,10 +178,7 @@ namespace Microsoft.AspNetCore.Razor.Runtime.TagHelpers throw new ArgumentNullException(nameof(attribute)); } - EnsureHtmlAttributes(); - EnsureAllAttributes(); - - _htmlAttributes.Add(attribute); + Output.Attributes.Add(attribute); _allAttributes.Add(attribute); } @@ -196,7 +194,6 @@ namespace Microsoft.AspNetCore.Razor.Runtime.TagHelpers throw new ArgumentNullException(nameof(name)); } - EnsureAllAttributes(); _allAttributes.Add(name, value); } @@ -236,16 +233,14 @@ namespace Microsoft.AspNetCore.Razor.Runtime.TagHelpers throw new ArgumentNullException(nameof(executeChildContentAsync)); } - _tagName = tagName; - _tagMode = tagMode; Items = items; - _uniqueId = uniqueId; _executeChildContentAsync = executeChildContentAsync; _tagHelpers.Clear(); _perEncoderChildContent?.Clear(); - _htmlAttributes = null; - _allAttributes = null; _childContent = null; + + Context.Reinitialize(Items, uniqueId); + Output.Reinitialize(tagName, tagMode); } // Internal for testing. @@ -288,21 +283,5 @@ namespace Microsoft.AspNetCore.Razor.Runtime.TagHelpers return new DefaultTagHelperContent().SetHtmlContent(childContent); } - - private void EnsureHtmlAttributes() - { - if (_htmlAttributes == null) - { - _htmlAttributes = new TagHelperAttributeList(); - } - } - - private void EnsureAllAttributes() - { - if (_allAttributes == null) - { - _allAttributes = new TagHelperAttributeList(); - } - } } } \ No newline at end of file diff --git a/src/Microsoft.AspNetCore.Razor.Runtime/Runtime/TagHelpers/TagHelperRunner.cs b/src/Microsoft.AspNetCore.Razor.Runtime/Runtime/TagHelpers/TagHelperRunner.cs index f945eaebb4..d4c18d2eb8 100644 --- a/src/Microsoft.AspNetCore.Razor.Runtime/Runtime/TagHelpers/TagHelperRunner.cs +++ b/src/Microsoft.AspNetCore.Razor.Runtime/Runtime/TagHelpers/TagHelperRunner.cs @@ -20,14 +20,14 @@ namespace Microsoft.AspNetCore.Razor.Runtime.TagHelpers /// /// Resulting from processing all of the /// 's s. - public async Task RunAsync(TagHelperExecutionContext executionContext) + public async Task RunAsync(TagHelperExecutionContext executionContext) { if (executionContext == null) { throw new ArgumentNullException(nameof(executionContext)); } - var tagHelperContext = executionContext.CreateTagHelperContext(); + var tagHelperContext = executionContext.Context; OrderTagHelpers(executionContext.TagHelpers); @@ -36,14 +36,12 @@ namespace Microsoft.AspNetCore.Razor.Runtime.TagHelpers executionContext.TagHelpers[i].Init(tagHelperContext); } - var tagHelperOutput = executionContext.CreateTagHelperOutput(); + var tagHelperOutput = executionContext.Output; for (var i = 0; i < executionContext.TagHelpers.Count; i++) { await executionContext.TagHelpers[i].ProcessAsync(tagHelperContext, tagHelperOutput); } - - return tagHelperOutput; } private static void OrderTagHelpers(IList tagHelpers) diff --git a/src/Microsoft.AspNetCore.Razor.Runtime/TagHelpers/DefaultTagHelperContent.cs b/src/Microsoft.AspNetCore.Razor.Runtime/TagHelpers/DefaultTagHelperContent.cs index c1d50b13de..458ab751f0 100644 --- a/src/Microsoft.AspNetCore.Razor.Runtime/TagHelpers/DefaultTagHelperContent.cs +++ b/src/Microsoft.AspNetCore.Razor.Runtime/TagHelpers/DefaultTagHelperContent.cs @@ -18,11 +18,14 @@ namespace Microsoft.AspNetCore.Razor.TagHelpers public class DefaultTagHelperContent : TagHelperContent { private List _buffer; + private bool _isModified; private List Buffer { get { + _isModified = true; + if (_buffer == null) { _buffer = new List(); @@ -33,7 +36,7 @@ namespace Microsoft.AspNetCore.Razor.TagHelpers } /// - public override bool IsModified => _buffer != null; + public override bool IsModified => _isModified; /// /// Returns true for a cleared . @@ -41,7 +44,7 @@ namespace Microsoft.AspNetCore.Razor.TagHelpers { get { - if (_buffer == null) + if (!IsModified) { return true; } @@ -83,7 +86,7 @@ namespace Microsoft.AspNetCore.Razor.TagHelpers { get { - if (_buffer == null) + if (!IsModified) { return true; } @@ -156,7 +159,7 @@ namespace Microsoft.AspNetCore.Razor.TagHelpers throw new ArgumentNullException(nameof(destination)); } - if (_buffer == null) + if (!IsModified) { return; } @@ -194,7 +197,7 @@ namespace Microsoft.AspNetCore.Razor.TagHelpers throw new ArgumentNullException(nameof(destination)); } - if (_buffer == null) + if (!IsModified) { return; } @@ -233,6 +236,13 @@ namespace Microsoft.AspNetCore.Razor.TagHelpers return this; } + /// + public override void Reinitialize() + { + _buffer?.Clear(); + _isModified = false; + } + /// public override string GetContent() { @@ -267,7 +277,7 @@ namespace Microsoft.AspNetCore.Razor.TagHelpers throw new ArgumentNullException(nameof(encoder)); } - if (_buffer == null) + if (!IsModified) { return; } diff --git a/src/Microsoft.AspNetCore.Razor.Runtime/TagHelpers/TagHelperContent.cs b/src/Microsoft.AspNetCore.Razor.Runtime/TagHelpers/TagHelperContent.cs index e13acddd95..16b81881c8 100644 --- a/src/Microsoft.AspNetCore.Razor.Runtime/TagHelpers/TagHelperContent.cs +++ b/src/Microsoft.AspNetCore.Razor.Runtime/TagHelpers/TagHelperContent.cs @@ -128,6 +128,13 @@ namespace Microsoft.AspNetCore.Razor.TagHelpers /// A reference to this instance after the clear operation has completed. public abstract TagHelperContent Clear(); + /// + /// Clears the , so it can be reused. + /// + /// This method does more than what does. It also resets the + /// flag. + public abstract void Reinitialize(); + /// public abstract void CopyTo(IHtmlContentBuilder destination); diff --git a/src/Microsoft.AspNetCore.Razor.Runtime/TagHelpers/TagHelperContext.cs b/src/Microsoft.AspNetCore.Razor.Runtime/TagHelpers/TagHelperContext.cs index e2d55529d2..d131d60369 100644 --- a/src/Microsoft.AspNetCore.Razor.Runtime/TagHelpers/TagHelperContext.cs +++ b/src/Microsoft.AspNetCore.Razor.Runtime/TagHelpers/TagHelperContext.cs @@ -11,7 +11,7 @@ namespace Microsoft.AspNetCore.Razor.TagHelpers /// public class TagHelperContext { - private static ReadOnlyTagHelperAttributeList EmptyAttributes = new TagHelperAttributeList(); + private readonly TagHelperAttributeList _allAttributes; /// /// Instantiates a new . @@ -21,7 +21,7 @@ namespace Microsoft.AspNetCore.Razor.TagHelpers /// The unique identifier for the source element this /// applies to. public TagHelperContext( - ReadOnlyTagHelperAttributeList allAttributes, + TagHelperAttributeList allAttributes, IDictionary items, string uniqueId) { @@ -35,7 +35,12 @@ namespace Microsoft.AspNetCore.Razor.TagHelpers throw new ArgumentNullException(nameof(uniqueId)); } - AllAttributes = allAttributes ?? EmptyAttributes; + if (allAttributes == null) + { + throw new ArgumentNullException(nameof(allAttributes)); + } + + _allAttributes = allAttributes; Items = items; UniqueId = uniqueId; } @@ -43,7 +48,7 @@ namespace Microsoft.AspNetCore.Razor.TagHelpers /// /// Every attribute associated with the current HTML element. /// - public ReadOnlyTagHelperAttributeList AllAttributes { get; } + public ReadOnlyTagHelperAttributeList AllAttributes => _allAttributes; /// /// Gets the collection of items used to communicate with other s. @@ -52,11 +57,23 @@ namespace Microsoft.AspNetCore.Razor.TagHelpers /// This is copy-on-write in order to ensure items added to this /// collection are visible only to other s targeting child elements. /// - public IDictionary Items { get; } + public IDictionary Items { get; private set; } /// /// An identifier unique to the HTML element this context is for. /// - public string UniqueId { get; } + public string UniqueId { get; private set; } + + /// + /// Clears the and updates its state with the provided values. + /// + /// The to use. + /// The unique id to use. + public void Reinitialize(IDictionary items, string uniqueId) + { + _allAttributes.Clear(); + Items = items; + UniqueId = uniqueId; + } } } \ No newline at end of file diff --git a/src/Microsoft.AspNetCore.Razor.Runtime/TagHelpers/TagHelperOutput.cs b/src/Microsoft.AspNetCore.Razor.Runtime/TagHelpers/TagHelperOutput.cs index 3baadfdcd5..d42dfc7eeb 100644 --- a/src/Microsoft.AspNetCore.Razor.Runtime/TagHelpers/TagHelperOutput.cs +++ b/src/Microsoft.AspNetCore.Razor.Runtime/TagHelpers/TagHelperOutput.cs @@ -15,7 +15,6 @@ namespace Microsoft.AspNetCore.Razor.TagHelpers public class TagHelperOutput : IHtmlContentContainer { private readonly Func> _getChildContentAsync; - private TagHelperAttributeList _attributes; private TagHelperContent _preElement; private TagHelperContent _preContent; private TagHelperContent _content; @@ -27,7 +26,7 @@ namespace Microsoft.AspNetCore.Razor.TagHelpers internal TagHelperOutput(string tagName) : this( tagName, - null, + new TagHelperAttributeList(), (useCachedResult, encoder) => Task.FromResult(new DefaultTagHelperContent())) { } @@ -51,9 +50,14 @@ namespace Microsoft.AspNetCore.Razor.TagHelpers throw new ArgumentNullException(nameof(getChildContentAsync)); } + if (attributes == null) + { + throw new ArgumentNullException(nameof(attributes)); + } + TagName = tagName; _getChildContentAsync = getChildContentAsync; - _attributes = attributes; + Attributes = attributes; } /// @@ -183,17 +187,26 @@ namespace Microsoft.AspNetCore.Razor.TagHelpers /// a Microsoft.AspNetCore.Mvc.Rendering.HtmlString instance. MVC converts most other types to a /// , then HTML encodes the result. /// - public TagHelperAttributeList Attributes - { - get - { - if (_attributes == null) - { - _attributes = new TagHelperAttributeList(); - } + public TagHelperAttributeList Attributes { get; } - return _attributes; - } + /// + /// Clears the and updates its state with the provided values. + /// + /// The tag name to use. + /// The to use. + public void Reinitialize(string tagName, TagMode tagMode) + { + TagName = tagName; + TagMode = tagMode; + Attributes.Clear(); + + _preElement?.Reinitialize(); + _preContent?.Reinitialize(); + _content?.Reinitialize(); + _postContent?.Reinitialize(); + _postElement?.Reinitialize(); + + _wasSuppressOutputCalled = false; } /// @@ -336,7 +349,7 @@ namespace Microsoft.AspNetCore.Razor.TagHelpers { destination.AppendHtml("<"); destination.AppendHtml(TagName); - + CopyAttributesTo(destination); if (TagMode == TagMode.SelfClosing) @@ -367,7 +380,7 @@ namespace Microsoft.AspNetCore.Razor.TagHelpers _preContent?.Clear(); _content?.Clear(); _postContent?.Clear(); - _attributes?.Clear(); + Attributes.Clear(); } public void WriteTo(TextWriter writer, HtmlEncoder encoder) @@ -392,9 +405,9 @@ namespace Microsoft.AspNetCore.Razor.TagHelpers writer.Write(TagName); // Perf: Avoid allocating enumerator - for (var i = 0; i < (_attributes?.Count ?? 0); i++) + for (var i = 0; i < (Attributes.Count); i++) { - var attribute = _attributes[i]; + var attribute = Attributes[i]; writer.Write(" "); writer.Write(attribute.Name); @@ -469,9 +482,9 @@ namespace Microsoft.AspNetCore.Razor.TagHelpers StringWriter stringWriter = null; // Perf: Avoid allocating enumerator - for (var i = 0; i < (_attributes?.Count ?? 0); i++) + for (var i = 0; i < (Attributes.Count); i++) { - var attribute = _attributes[i]; + var attribute = Attributes[i]; destination.AppendHtml(" "); destination.AppendHtml(attribute.Name); diff --git a/src/Microsoft.AspNetCore.Razor/CodeGenerators/CSharpTagHelperCodeRenderer.cs b/src/Microsoft.AspNetCore.Razor/CodeGenerators/CSharpTagHelperCodeRenderer.cs index 7faa0d4723..93ec604d4c 100644 --- a/src/Microsoft.AspNetCore.Razor/CodeGenerators/CSharpTagHelperCodeRenderer.cs +++ b/src/Microsoft.AspNetCore.Razor/CodeGenerators/CSharpTagHelperCodeRenderer.cs @@ -620,15 +620,11 @@ namespace Microsoft.AspNetCore.Razor.CodeGenerators private void RenderRunTagHelpers() { - _writer.Write(ExecutionContextVariableName) - .Write(".") - .WriteStartAssignment(_tagHelperContext.ExecutionContextOutputPropertyName) - .Write("await ") - .WriteStartInstanceMethodInvocation(RunnerVariableName, - _tagHelperContext.RunnerRunAsyncMethodName); - - _writer.Write(ExecutionContextVariableName) - .WriteEndMethodInvocation(); + _writer + .Write("await ") + .WriteStartInstanceMethodInvocation(RunnerVariableName, _tagHelperContext.RunnerRunAsyncMethodName) + .Write(ExecutionContextVariableName) + .WriteEndMethodInvocation(); } private void RenderBufferedAttributeValue(TagHelperAttributeDescriptor attributeDescriptor) diff --git a/test/Microsoft.AspNetCore.Razor.Runtime.Test/Runtime/TagHelpers/TagHelperExecutionContextTest.cs b/test/Microsoft.AspNetCore.Razor.Runtime.Test/Runtime/TagHelpers/TagHelperExecutionContextTest.cs index 88278b4abc..e6e0103b65 100644 --- a/test/Microsoft.AspNetCore.Razor.Runtime.Test/Runtime/TagHelpers/TagHelperExecutionContextTest.cs +++ b/test/Microsoft.AspNetCore.Razor.Runtime.Test/Runtime/TagHelpers/TagHelperExecutionContextTest.cs @@ -56,7 +56,7 @@ namespace Microsoft.AspNetCore.Razor.Runtime.TagHelpers executionContext.AddMinimizedHtmlAttribute("Another attribute"); // Assert - 1 - var output = executionContext.CreateTagHelperOutput(); + var output = executionContext.Output; Assert.Equal(updatedTagName, output.TagName); Assert.Equal(updatedTagMode, output.TagMode); var attribute = Assert.Single(output.Attributes); @@ -108,7 +108,7 @@ namespace Microsoft.AspNetCore.Razor.Runtime.TagHelpers executionContext.AddMinimizedHtmlAttribute("Another attribute"); // Assert - var context = executionContext.CreateTagHelperContext(); + var context = executionContext.Context; var attribute = Assert.Single(context.AllAttributes); Assert.Equal(attribute.Name, "Another attribute"); Assert.Equal(updatedUniqueId, context.UniqueId); @@ -125,7 +125,7 @@ namespace Microsoft.AspNetCore.Razor.Runtime.TagHelpers var executionContext = new TagHelperExecutionContext("p", tagMode); // Act - var output = executionContext.CreateTagHelperOutput(); + var output = executionContext.Output; // Assert Assert.Equal(tagMode, output.TagMode); @@ -388,7 +388,7 @@ namespace Microsoft.AspNetCore.Razor.Runtime.TagHelpers // Act executionContext.AddHtmlAttribute("class", "btn"); executionContext.AddHtmlAttribute("foo", "bar"); - var output = executionContext.CreateTagHelperOutput(); + var output = executionContext.Output; // Assert Assert.Equal( @@ -411,7 +411,7 @@ namespace Microsoft.AspNetCore.Razor.Runtime.TagHelpers // Act executionContext.AddMinimizedHtmlAttribute("checked"); executionContext.AddMinimizedHtmlAttribute("visible"); - var output = executionContext.CreateTagHelperOutput(); + var output = executionContext.Output; // Assert Assert.Equal( @@ -438,7 +438,7 @@ namespace Microsoft.AspNetCore.Razor.Runtime.TagHelpers executionContext.AddHtmlAttribute("foo", "bar"); executionContext.AddMinimizedHtmlAttribute("checked"); executionContext.AddMinimizedHtmlAttribute("visible"); - var output = executionContext.CreateTagHelperOutput(); + var output = executionContext.Output; // Assert Assert.Equal( @@ -463,7 +463,7 @@ namespace Microsoft.AspNetCore.Razor.Runtime.TagHelpers executionContext.AddHtmlAttribute("class", "btn"); executionContext.AddTagHelperAttribute("something", true); executionContext.AddHtmlAttribute("foo", "bar"); - var context = executionContext.CreateTagHelperContext(); + var context = executionContext.Context; // Assert Assert.Equal( diff --git a/test/Microsoft.AspNetCore.Razor.Runtime.Test/Runtime/TagHelpers/TagHelperRunnerTest.cs b/test/Microsoft.AspNetCore.Razor.Runtime.Test/Runtime/TagHelpers/TagHelperRunnerTest.cs index 7150164e17..d318d8889b 100644 --- a/test/Microsoft.AspNetCore.Razor.Runtime.Test/Runtime/TagHelpers/TagHelperRunnerTest.cs +++ b/test/Microsoft.AspNetCore.Razor.Runtime.Test/Runtime/TagHelpers/TagHelperRunnerTest.cs @@ -127,10 +127,10 @@ namespace Microsoft.AspNetCore.Razor.Runtime.TagHelpers executionContext.AddTagHelperAttribute("foo", true); // Act - var output = await runner.RunAsync(executionContext); + await runner.RunAsync(executionContext); // Assert - Assert.Equal(tagMode, output.TagMode); + Assert.Equal(tagMode, executionContext.Output.TagMode); } [Fact] @@ -163,9 +163,10 @@ namespace Microsoft.AspNetCore.Razor.Runtime.TagHelpers // Act executionContext.Add(executableTagHelper); executionContext.AddHtmlAttribute("class", "btn"); - var output = await runner.RunAsync(executionContext); + await runner.RunAsync(executionContext); // Assert + var output = executionContext.Output; Assert.Equal("foo", output.TagName); Assert.Equal("somethingelse", output.Attributes["class"].Value); Assert.Equal("world", output.Attributes["hello"].Value); @@ -183,10 +184,10 @@ namespace Microsoft.AspNetCore.Razor.Runtime.TagHelpers // Act executionContext.Add(tagHelper); executionContext.AddTagHelperAttribute("foo", true); - var output = await runner.RunAsync(executionContext); + await runner.RunAsync(executionContext); // Assert - Assert.Equal("True", output.Attributes["foo"].Value); + Assert.Equal("True", executionContext.Output.Attributes["foo"].Value); } [Fact] diff --git a/test/Microsoft.AspNetCore.Razor.Runtime.Test/Runtime/TagHelpers/TagHelperScopeManagerTest.cs b/test/Microsoft.AspNetCore.Razor.Runtime.Test/Runtime/TagHelpers/TagHelperScopeManagerTest.cs index 98d6a433ca..f66cdf7806 100644 --- a/test/Microsoft.AspNetCore.Razor.Runtime.Test/Runtime/TagHelpers/TagHelperScopeManagerTest.cs +++ b/test/Microsoft.AspNetCore.Razor.Runtime.Test/Runtime/TagHelpers/TagHelperScopeManagerTest.cs @@ -132,7 +132,7 @@ namespace Microsoft.AspNetCore.Razor.Runtime.TagHelpers // Act var executionContext = BeginDefaultScope(scopeManager, tagName: "p"); - var output = executionContext.CreateTagHelperOutput(); + var output = executionContext.Output; // Assert Assert.Equal("p", output.TagName); @@ -147,7 +147,7 @@ namespace Microsoft.AspNetCore.Razor.Runtime.TagHelpers // Act var executionContext = BeginDefaultScope(scopeManager, tagName: "p"); executionContext = BeginDefaultScope(scopeManager, tagName: "div"); - var output = executionContext.CreateTagHelperOutput(); + var output = executionContext.Output; // Assert Assert.Equal("div", output.TagName); @@ -164,7 +164,7 @@ namespace Microsoft.AspNetCore.Razor.Runtime.TagHelpers // Act var executionContext = BeginDefaultScope(scopeManager, "p", tagMode); - var output = executionContext.CreateTagHelperOutput(); + var output = executionContext.Output; // Assert Assert.Equal(tagMode, output.TagMode); @@ -180,7 +180,7 @@ namespace Microsoft.AspNetCore.Razor.Runtime.TagHelpers var executionContext = BeginDefaultScope(scopeManager, tagName: "p"); executionContext = BeginDefaultScope(scopeManager, tagName: "div"); executionContext = scopeManager.End(); - var output = executionContext.CreateTagHelperOutput(); + var output = executionContext.Output; // Assert Assert.Equal("p", output.TagName); diff --git a/test/Microsoft.AspNetCore.Razor.Runtime.Test/TagHelpers/DefaultTagHelperContentTest.cs b/test/Microsoft.AspNetCore.Razor.Runtime.Test/TagHelpers/DefaultTagHelperContentTest.cs index d818daad20..da919abab9 100644 --- a/test/Microsoft.AspNetCore.Razor.Runtime.Test/TagHelpers/DefaultTagHelperContentTest.cs +++ b/test/Microsoft.AspNetCore.Razor.Runtime.Test/TagHelpers/DefaultTagHelperContentTest.cs @@ -12,6 +12,20 @@ namespace Microsoft.AspNetCore.Razor.TagHelpers { public class DefaultTagHelperContentTest { + [Fact] + public void Reset_ClearsTheExpectedFields() + { + // Arrange + var tagHelperContent = new DefaultTagHelperContent(); + tagHelperContent.SetContent("hello world"); + + // Act + tagHelperContent.Reinitialize(); + + Assert.False(tagHelperContent.IsModified); + Assert.Equal(string.Empty, tagHelperContent.GetContent()); + } + [Fact] public void CanSetContent() { diff --git a/test/Microsoft.AspNetCore.Razor.Runtime.Test/TagHelpers/TagHelperContextTest.cs b/test/Microsoft.AspNetCore.Razor.Runtime.Test/TagHelpers/TagHelperContextTest.cs index 42f010a268..c3cf7a64a0 100644 --- a/test/Microsoft.AspNetCore.Razor.Runtime.Test/TagHelpers/TagHelperContextTest.cs +++ b/test/Microsoft.AspNetCore.Razor.Runtime.Test/TagHelpers/TagHelperContextTest.cs @@ -9,6 +9,35 @@ namespace Microsoft.AspNetCore.Razor.TagHelpers { public class TagHelperContextTest { + [Fact] + public void Reinitialize_AllowsContextToBeReused() + { + // Arrange + var initialUniqueId = "123"; + var expectedUniqueId = "456"; + var initialItems = new Dictionary + { + { "test-entry", 1234 } + }; + var expectedItems = new Dictionary + { + { "something", "new" } + }; + var initialAttributes = new TagHelperAttributeList + { + { "name", "value" } + }; + var context = new TagHelperContext(initialAttributes, initialItems, initialUniqueId); + + // Act + context.Reinitialize(expectedItems, expectedUniqueId); + + // Assert + Assert.Same(expectedItems, context.Items); + Assert.Equal(expectedUniqueId, context.UniqueId); + Assert.Empty(context.AllAttributes); + } + [Fact] public void Constructor_SetsProperties_AsExpected() { diff --git a/test/Microsoft.AspNetCore.Razor.Runtime.Test/TagHelpers/TagHelperOutputTest.cs b/test/Microsoft.AspNetCore.Razor.Runtime.Test/TagHelpers/TagHelperOutputTest.cs index 440a4587db..c5970fb78b 100644 --- a/test/Microsoft.AspNetCore.Razor.Runtime.Test/TagHelpers/TagHelperOutputTest.cs +++ b/test/Microsoft.AspNetCore.Razor.Runtime.Test/TagHelpers/TagHelperOutputTest.cs @@ -16,6 +16,55 @@ namespace Microsoft.AspNetCore.Razor.TagHelpers { public class TagHelperOutputTest { + [Fact] + public async Task Reinitialize_AllowsOutputToBeReused() + { + // Arrange + var initialOutputChildContent = new DefaultTagHelperContent(); + initialOutputChildContent.SetContent("Initial output content."); + var expectedGetChildContentContent = "Initial get child content content"; + var initialGetChildContent = new DefaultTagHelperContent(); + initialGetChildContent.SetContent(expectedGetChildContentContent); + Func> initialGetChildContentAsync = + (useCachedResult, encoder) => Task.FromResult(initialGetChildContent); + var initialTagMode = TagMode.StartTagOnly; + var initialAttributes = new TagHelperAttributeList + { + { "name", "value" } + }; + var initialTagName = "initialTagName"; + var output = new TagHelperOutput(initialTagName, initialAttributes, initialGetChildContentAsync) + { + TagMode = initialTagMode, + Content = initialOutputChildContent, + }; + output.PreContent.SetContent("something"); + output.PostContent.SetContent("something"); + output.PreElement.SetContent("something"); + output.PostElement.SetContent("something"); + var expectedTagName = "newTagName"; + var expectedTagMode = TagMode.SelfClosing; + + // Act + output.Reinitialize(expectedTagName, expectedTagMode); + + // Assert + Assert.Equal(expectedTagName, output.TagName); + Assert.Equal(expectedTagMode, output.TagMode); + Assert.Empty(output.Attributes); + + var getChildContent = await output.GetChildContentAsync(); + var content = getChildContent.GetContent(); + + // We're expecting the initial child content here because normally the TagHelper infrastructure would + // swap out the inner workings of GetChildContentAsync to work with its reinitialized state. + Assert.Equal(expectedGetChildContentContent, content); + Assert.False(output.PreContent.IsModified); + Assert.False(output.PostContent.IsModified); + Assert.False(output.PreElement.IsModified); + Assert.False(output.PostElement.IsModified); + } + [Fact] public async Task GetChildContentAsync_CallsGetChildContentAsync() { diff --git a/test/Microsoft.AspNetCore.Razor.Test/TestFiles/CodeGenerator/Output/AttributeTargetingTagHelpers.cs b/test/Microsoft.AspNetCore.Razor.Test/TestFiles/CodeGenerator/Output/AttributeTargetingTagHelpers.cs index c2415ea8ab..dc1531366e 100644 --- a/test/Microsoft.AspNetCore.Razor.Test/TestFiles/CodeGenerator/Output/AttributeTargetingTagHelpers.cs +++ b/test/Microsoft.AspNetCore.Razor.Test/TestFiles/CodeGenerator/Output/AttributeTargetingTagHelpers.cs @@ -44,7 +44,7 @@ namespace TestOutput __TestNamespace_CatchAllTagHelper = CreateTagHelper(); __tagHelperExecutionContext.Add(__TestNamespace_CatchAllTagHelper); __tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_1); - __tagHelperExecutionContext.Output = await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); + await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); if (!__tagHelperExecutionContext.Output.IsContentModified) { __tagHelperExecutionContext.Output.Content = await __tagHelperExecutionContext.Output.GetChildContentAsync(); @@ -72,7 +72,7 @@ __TestNamespace_InputTagHelper2.Checked = true; #line default #line hidden __tagHelperExecutionContext.AddTagHelperAttribute("checked", __TestNamespace_InputTagHelper2.Checked); - __tagHelperExecutionContext.Output = await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); + await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); Instrumentation.BeginContext(152, 40, false); Write(__tagHelperExecutionContext.Output); Instrumentation.EndContext(); @@ -99,7 +99,7 @@ __TestNamespace_InputTagHelper2.Checked = true; #line hidden __tagHelperExecutionContext.AddTagHelperAttribute("checked", __TestNamespace_InputTagHelper2.Checked); __tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_1); - __tagHelperExecutionContext.Output = await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); + await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); Instrumentation.BeginContext(198, 54, false); Write(__tagHelperExecutionContext.Output); Instrumentation.EndContext(); @@ -112,7 +112,7 @@ __TestNamespace_InputTagHelper2.Checked = true; __TestNamespace_PTagHelper = CreateTagHelper(); __tagHelperExecutionContext.Add(__TestNamespace_PTagHelper); __tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_0); - __tagHelperExecutionContext.Output = await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); + await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); if (!__tagHelperExecutionContext.Output.IsContentModified) { __tagHelperExecutionContext.Output.Content = await __tagHelperExecutionContext.Output.GetChildContentAsync(); diff --git a/test/Microsoft.AspNetCore.Razor.Test/TestFiles/CodeGenerator/Output/BasicTagHelpers.CustomAttributeCodeGenerator.cs b/test/Microsoft.AspNetCore.Razor.Test/TestFiles/CodeGenerator/Output/BasicTagHelpers.CustomAttributeCodeGenerator.cs index 5a7ff58615..d86203ceda 100644 --- a/test/Microsoft.AspNetCore.Razor.Test/TestFiles/CodeGenerator/Output/BasicTagHelpers.CustomAttributeCodeGenerator.cs +++ b/test/Microsoft.AspNetCore.Razor.Test/TestFiles/CodeGenerator/Output/BasicTagHelpers.CustomAttributeCodeGenerator.cs @@ -40,7 +40,7 @@ namespace TestOutput __TestNamespace_PTagHelper = CreateTagHelper(); __tagHelperExecutionContext.Add(__TestNamespace_PTagHelper); __tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_2); - __tagHelperExecutionContext.Output = await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); + await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); Instrumentation.BeginContext(155, 25, false); Write(__tagHelperExecutionContext.Output); Instrumentation.EndContext(); @@ -68,7 +68,7 @@ namespace TestOutput __TestNamespace_InputTagHelper.Type = **From custom attribute code renderer**: "text"; __tagHelperExecutionContext.AddTagHelperAttribute("type", __TestNamespace_InputTagHelper.Type); __TestNamespace_InputTagHelper2.Type = __TestNamespace_InputTagHelper.Type; - __tagHelperExecutionContext.Output = await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); + await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); Instrumentation.BeginContext(190, 71, false); Write(__tagHelperExecutionContext.Output); Instrumentation.EndContext(); @@ -92,7 +92,7 @@ __TestNamespace_InputTagHelper2.Checked = **From custom attribute code renderer* #line default #line hidden __tagHelperExecutionContext.AddTagHelperAttribute("checked", __TestNamespace_InputTagHelper2.Checked); - __tagHelperExecutionContext.Output = await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); + await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); Instrumentation.BeginContext(271, 39, false); Write(__tagHelperExecutionContext.Output); Instrumentation.EndContext(); @@ -106,7 +106,7 @@ __TestNamespace_InputTagHelper2.Checked = **From custom attribute code renderer* __tagHelperExecutionContext.Add(__TestNamespace_PTagHelper); __tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_0); __tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_1); - __tagHelperExecutionContext.Output = await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); + await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); if (!__tagHelperExecutionContext.Output.IsContentModified) { __tagHelperExecutionContext.Output.Content = await __tagHelperExecutionContext.Output.GetChildContentAsync(); diff --git a/test/Microsoft.AspNetCore.Razor.Test/TestFiles/CodeGenerator/Output/BasicTagHelpers.Prefixed.cs b/test/Microsoft.AspNetCore.Razor.Test/TestFiles/CodeGenerator/Output/BasicTagHelpers.Prefixed.cs index dc51b3d5c7..d42bdc4786 100644 --- a/test/Microsoft.AspNetCore.Razor.Test/TestFiles/CodeGenerator/Output/BasicTagHelpers.Prefixed.cs +++ b/test/Microsoft.AspNetCore.Razor.Test/TestFiles/CodeGenerator/Output/BasicTagHelpers.Prefixed.cs @@ -49,7 +49,7 @@ namespace TestOutput #line default #line hidden __tagHelperExecutionContext.AddTagHelperAttribute("checked", __TestNamespace_InputTagHelper2.Checked); - __tagHelperExecutionContext.Output = await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); + await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); Instrumentation.BeginContext(189, 41, false); Write(__tagHelperExecutionContext.Output); Instrumentation.EndContext(); @@ -62,7 +62,7 @@ namespace TestOutput __TestNamespace_PTagHelper = CreateTagHelper(); __tagHelperExecutionContext.Add(__TestNamespace_PTagHelper); __tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_0); - __tagHelperExecutionContext.Output = await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); + await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); if (!__tagHelperExecutionContext.Output.IsContentModified) { __tagHelperExecutionContext.Output.Content = await __tagHelperExecutionContext.Output.GetChildContentAsync(); diff --git a/test/Microsoft.AspNetCore.Razor.Test/TestFiles/CodeGenerator/Output/BasicTagHelpers.cs b/test/Microsoft.AspNetCore.Razor.Test/TestFiles/CodeGenerator/Output/BasicTagHelpers.cs index ce273af408..895cebdf9a 100644 --- a/test/Microsoft.AspNetCore.Razor.Test/TestFiles/CodeGenerator/Output/BasicTagHelpers.cs +++ b/test/Microsoft.AspNetCore.Razor.Test/TestFiles/CodeGenerator/Output/BasicTagHelpers.cs @@ -41,7 +41,7 @@ namespace TestOutput __TestNamespace_PTagHelper = CreateTagHelper(); __tagHelperExecutionContext.Add(__TestNamespace_PTagHelper); __tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_2); - __tagHelperExecutionContext.Output = await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); + await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); Instrumentation.BeginContext(155, 25, false); Write(__tagHelperExecutionContext.Output); Instrumentation.EndContext(); @@ -69,7 +69,7 @@ namespace TestOutput __TestNamespace_InputTagHelper.Type = "text"; __tagHelperExecutionContext.AddTagHelperAttribute("type", __TestNamespace_InputTagHelper.Type); __TestNamespace_InputTagHelper2.Type = __TestNamespace_InputTagHelper.Type; - __tagHelperExecutionContext.Output = await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); + await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); Instrumentation.BeginContext(190, 71, false); Write(__tagHelperExecutionContext.Output); Instrumentation.EndContext(); @@ -93,7 +93,7 @@ __TestNamespace_InputTagHelper2.Checked = true; #line default #line hidden __tagHelperExecutionContext.AddTagHelperAttribute("checked", __TestNamespace_InputTagHelper2.Checked); - __tagHelperExecutionContext.Output = await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); + await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); Instrumentation.BeginContext(271, 39, false); Write(__tagHelperExecutionContext.Output); Instrumentation.EndContext(); @@ -107,7 +107,7 @@ __TestNamespace_InputTagHelper2.Checked = true; __tagHelperExecutionContext.Add(__TestNamespace_PTagHelper); __tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_0); __tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_1); - __tagHelperExecutionContext.Output = await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); + await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); if (!__tagHelperExecutionContext.Output.IsContentModified) { __tagHelperExecutionContext.Output.Content = await __tagHelperExecutionContext.Output.GetChildContentAsync(); diff --git a/test/Microsoft.AspNetCore.Razor.Test/TestFiles/CodeGenerator/Output/ComplexTagHelpers.cs b/test/Microsoft.AspNetCore.Razor.Test/TestFiles/CodeGenerator/Output/ComplexTagHelpers.cs index 7a552b4f48..29f64215b9 100644 --- a/test/Microsoft.AspNetCore.Razor.Test/TestFiles/CodeGenerator/Output/ComplexTagHelpers.cs +++ b/test/Microsoft.AspNetCore.Razor.Test/TestFiles/CodeGenerator/Output/ComplexTagHelpers.cs @@ -83,7 +83,7 @@ namespace TestOutput __TestNamespace_InputTagHelper2.Type = __TestNamespace_InputTagHelper.Type; __tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_0); __tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_1); - __tagHelperExecutionContext.Output = await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); + await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); Instrumentation.BeginContext(278, 66, false); Write(__tagHelperExecutionContext.Output); Instrumentation.EndContext(); @@ -92,7 +92,7 @@ namespace TestOutput , StartTagHelperWritingScope, EndTagHelperWritingScope); __TestNamespace_PTagHelper = CreateTagHelper(); __tagHelperExecutionContext.Add(__TestNamespace_PTagHelper); - __tagHelperExecutionContext.Output = await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); + await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); if (!__tagHelperExecutionContext.Output.IsContentModified) { __tagHelperExecutionContext.Output.Content = await __tagHelperExecutionContext.Output.GetChildContentAsync(); @@ -142,7 +142,7 @@ namespace TestOutput #line default #line hidden __tagHelperExecutionContext.AddTagHelperAttribute("checked", __TestNamespace_InputTagHelper2.Checked); - __tagHelperExecutionContext.Output = await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); + await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); Instrumentation.BeginContext(431, 37, false); Write(__tagHelperExecutionContext.Output); Instrumentation.EndContext(); @@ -151,7 +151,7 @@ namespace TestOutput , StartTagHelperWritingScope, EndTagHelperWritingScope); __TestNamespace_PTagHelper = CreateTagHelper(); __tagHelperExecutionContext.Add(__TestNamespace_PTagHelper); - __tagHelperExecutionContext.Output = await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); + await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); if (!__tagHelperExecutionContext.Output.IsContentModified) { __tagHelperExecutionContext.Output.Content = await __tagHelperExecutionContext.Output.GetChildContentAsync(); @@ -180,7 +180,7 @@ namespace TestOutput __TestNamespace_InputTagHelper.Type = __tagHelperStringValueBuffer.GetContent(HtmlEncoder); __tagHelperExecutionContext.AddTagHelperAttribute("tYPe", __TestNamespace_InputTagHelper.Type); __TestNamespace_InputTagHelper2.Type = __TestNamespace_InputTagHelper.Type; - __tagHelperExecutionContext.Output = await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); + await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); Instrumentation.BeginContext(490, 50, false); Write(__tagHelperExecutionContext.Output); Instrumentation.EndContext(); @@ -232,7 +232,7 @@ namespace TestOutput __TestNamespace_InputTagHelper.Type = __tagHelperStringValueBuffer.GetContent(HtmlEncoder); __tagHelperExecutionContext.AddTagHelperAttribute("type", __TestNamespace_InputTagHelper.Type); __TestNamespace_InputTagHelper2.Type = __TestNamespace_InputTagHelper.Type; - __tagHelperExecutionContext.Output = await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); + await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); Instrumentation.BeginContext(558, 79, false); Write(__tagHelperExecutionContext.Output); Instrumentation.EndContext(); @@ -262,7 +262,7 @@ AddHtmlAttributeValue(" ", 159, DateTime.Now, 160, 14, false); #line default #line hidden EndAddHtmlAttributeValues(__tagHelperExecutionContext); - __tagHelperExecutionContext.Output = await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); + await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); if (!__tagHelperExecutionContext.Output.IsContentModified) { __tagHelperExecutionContext.Output.Content = await __tagHelperExecutionContext.Output.GetChildContentAsync(); @@ -306,7 +306,7 @@ __TestNamespace_InputTagHelper2.Checked = (@object); #line default #line hidden __tagHelperExecutionContext.AddTagHelperAttribute("ChecKED", __TestNamespace_InputTagHelper2.Checked); - __tagHelperExecutionContext.Output = await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); + await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); Instrumentation.BeginContext(817, 28, false); Write(__tagHelperExecutionContext.Output); Instrumentation.EndContext(); @@ -326,7 +326,7 @@ __TestNamespace_InputTagHelper2.Checked = (@object); #line hidden __tagHelperExecutionContext.AddTagHelperAttribute("age", __TestNamespace_PTagHelper.Age); __tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_3); - __tagHelperExecutionContext.Output = await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); + await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); if (!__tagHelperExecutionContext.Output.IsContentModified) { __tagHelperExecutionContext.Output.Content = await __tagHelperExecutionContext.Output.GetChildContentAsync(); @@ -357,7 +357,7 @@ __TestNamespace_InputTagHelper2.Checked = (@object); #line default #line hidden __tagHelperExecutionContext.AddTagHelperAttribute("checked", __TestNamespace_InputTagHelper2.Checked); - __tagHelperExecutionContext.Output = await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); + await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); Instrumentation.BeginContext(925, 85, false); Write(__tagHelperExecutionContext.Output); Instrumentation.EndContext(); @@ -375,7 +375,7 @@ __TestNamespace_PTagHelper.Age = -1970 + @DateTimeOffset.Now.Year; #line default #line hidden __tagHelperExecutionContext.AddTagHelperAttribute("age", __TestNamespace_PTagHelper.Age); - __tagHelperExecutionContext.Output = await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); + await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); if (!__tagHelperExecutionContext.Output.IsContentModified) { __tagHelperExecutionContext.Output.Content = await __tagHelperExecutionContext.Output.GetChildContentAsync(); @@ -404,7 +404,7 @@ __TestNamespace_InputTagHelper2.Checked = DateTimeOffset.Now.Year > 2014; #line default #line hidden __tagHelperExecutionContext.AddTagHelperAttribute("checked", __TestNamespace_InputTagHelper2.Checked); - __tagHelperExecutionContext.Output = await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); + await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); Instrumentation.BeginContext(1088, 48, false); Write(__tagHelperExecutionContext.Output); Instrumentation.EndContext(); @@ -422,7 +422,7 @@ __TestNamespace_PTagHelper.Age = DateTimeOffset.Now.Year - 1970; #line default #line hidden __tagHelperExecutionContext.AddTagHelperAttribute("age", __TestNamespace_PTagHelper.Age); - __tagHelperExecutionContext.Output = await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); + await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); if (!__tagHelperExecutionContext.Output.IsContentModified) { __tagHelperExecutionContext.Output.Content = await __tagHelperExecutionContext.Output.GetChildContentAsync(); @@ -451,7 +451,7 @@ __TestNamespace_InputTagHelper2.Checked = @( DateTimeOffset.Now.Year ) > 20 #line default #line hidden __tagHelperExecutionContext.AddTagHelperAttribute("checked", __TestNamespace_InputTagHelper2.Checked); - __tagHelperExecutionContext.Output = await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); + await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); Instrumentation.BeginContext(1216, 63, false); Write(__tagHelperExecutionContext.Output); Instrumentation.EndContext(); @@ -469,7 +469,7 @@ __TestNamespace_PTagHelper.Age = ("My age is this long.".Length); #line default #line hidden __tagHelperExecutionContext.AddTagHelperAttribute("age", __TestNamespace_PTagHelper.Age); - __tagHelperExecutionContext.Output = await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); + await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); if (!__tagHelperExecutionContext.Output.IsContentModified) { __tagHelperExecutionContext.Output.Content = await __tagHelperExecutionContext.Output.GetChildContentAsync(); @@ -498,7 +498,7 @@ __TestNamespace_PTagHelper.Age = ("My age is this long.".Length); #line default #line hidden __tagHelperExecutionContext.AddTagHelperAttribute("checked", __TestNamespace_InputTagHelper2.Checked); - __tagHelperExecutionContext.Output = await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); + await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); Instrumentation.BeginContext(1343, 26, false); Write(__tagHelperExecutionContext.Output); Instrumentation.EndContext(); @@ -514,7 +514,7 @@ __TestNamespace_PTagHelper.Age = 123; #line hidden __tagHelperExecutionContext.AddTagHelperAttribute("age", __TestNamespace_PTagHelper.Age); __tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_6); - __tagHelperExecutionContext.Output = await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); + await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); if (!__tagHelperExecutionContext.Output.IsContentModified) { __tagHelperExecutionContext.Output.Content = await __tagHelperExecutionContext.Output.GetChildContentAsync(); diff --git a/test/Microsoft.AspNetCore.Razor.Test/TestFiles/CodeGenerator/Output/CssSelectorTagHelperAttributes.cs b/test/Microsoft.AspNetCore.Razor.Test/TestFiles/CodeGenerator/Output/CssSelectorTagHelperAttributes.cs index 9370be99be..d9694486ab 100644 --- a/test/Microsoft.AspNetCore.Razor.Test/TestFiles/CodeGenerator/Output/CssSelectorTagHelperAttributes.cs +++ b/test/Microsoft.AspNetCore.Razor.Test/TestFiles/CodeGenerator/Output/CssSelectorTagHelperAttributes.cs @@ -48,7 +48,7 @@ namespace TestOutput __TestNamespace_CatchAllTagHelper = CreateTagHelper(); __tagHelperExecutionContext.Add(__TestNamespace_CatchAllTagHelper); __tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_0); - __tagHelperExecutionContext.Output = await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); + await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); if (!__tagHelperExecutionContext.Output.IsContentModified) { __tagHelperExecutionContext.Output.Content = await __tagHelperExecutionContext.Output.GetChildContentAsync(); @@ -69,7 +69,7 @@ namespace TestOutput __TestNamespace_CatchAllTagHelper = CreateTagHelper(); __tagHelperExecutionContext.Add(__TestNamespace_CatchAllTagHelper); __tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_1); - __tagHelperExecutionContext.Output = await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); + await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); if (!__tagHelperExecutionContext.Output.IsContentModified) { __tagHelperExecutionContext.Output.Content = await __tagHelperExecutionContext.Output.GetChildContentAsync(); @@ -92,7 +92,7 @@ namespace TestOutput __TestNamespace_CatchAllTagHelper = CreateTagHelper(); __tagHelperExecutionContext.Add(__TestNamespace_CatchAllTagHelper); __tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_2); - __tagHelperExecutionContext.Output = await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); + await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); if (!__tagHelperExecutionContext.Output.IsContentModified) { __tagHelperExecutionContext.Output.Content = await __tagHelperExecutionContext.Output.GetChildContentAsync(); @@ -123,7 +123,7 @@ AddHtmlAttributeValue("", 152, false, 152, 6, false); #line hidden AddHtmlAttributeValue("", 158, "?hello=world", 158, 12, true); EndAddHtmlAttributeValues(__tagHelperExecutionContext); - __tagHelperExecutionContext.Output = await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); + await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); if (!__tagHelperExecutionContext.Output.IsContentModified) { __tagHelperExecutionContext.Output.Content = await __tagHelperExecutionContext.Output.GetChildContentAsync(); @@ -151,7 +151,7 @@ AddHtmlAttributeValue("", 233, false, 233, 6, false); #line default #line hidden EndAddHtmlAttributeValues(__tagHelperExecutionContext); - __tagHelperExecutionContext.Output = await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); + await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); if (!__tagHelperExecutionContext.Output.IsContentModified) { __tagHelperExecutionContext.Output.Content = await __tagHelperExecutionContext.Output.GetChildContentAsync(); @@ -172,7 +172,7 @@ AddHtmlAttributeValue("", 233, false, 233, 6, false); __TestNamespace_CatchAllTagHelper = CreateTagHelper(); __tagHelperExecutionContext.Add(__TestNamespace_CatchAllTagHelper); __tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_3); - __tagHelperExecutionContext.Output = await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); + await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); if (!__tagHelperExecutionContext.Output.IsContentModified) { __tagHelperExecutionContext.Output.Content = await __tagHelperExecutionContext.Output.GetChildContentAsync(); @@ -200,7 +200,7 @@ AddHtmlAttributeValue(" ", 328, false, 329, 7, false); #line default #line hidden EndAddHtmlAttributeValues(__tagHelperExecutionContext); - __tagHelperExecutionContext.Output = await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); + await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); if (!__tagHelperExecutionContext.Output.IsContentModified) { __tagHelperExecutionContext.Output.Content = await __tagHelperExecutionContext.Output.GetChildContentAsync(); @@ -225,7 +225,7 @@ AddHtmlAttributeValue(" ", 328, false, 329, 7, false); __tagHelperExecutionContext.AddTagHelperAttribute("type", __TestNamespace_InputTagHelper.Type); __TestNamespace_InputTagHelper2.Type = __TestNamespace_InputTagHelper.Type; __tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_4); - __tagHelperExecutionContext.Output = await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); + await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); Instrumentation.BeginContext(354, 42, false); Write(__tagHelperExecutionContext.Output); Instrumentation.EndContext(); @@ -243,7 +243,7 @@ AddHtmlAttributeValue(" ", 328, false, 329, 7, false); __TestNamespace_InputTagHelper2.Type = "texty"; __tagHelperExecutionContext.AddTagHelperAttribute("type", __TestNamespace_InputTagHelper2.Type); __tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_4); - __tagHelperExecutionContext.Output = await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); + await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); Instrumentation.BeginContext(398, 43, false); Write(__tagHelperExecutionContext.Output); Instrumentation.EndContext(); @@ -261,7 +261,7 @@ AddHtmlAttributeValue(" ", 328, false, 329, 7, false); __TestNamespace_InputTagHelper2.Type = "checkbox"; __tagHelperExecutionContext.AddTagHelperAttribute("type", __TestNamespace_InputTagHelper2.Type); __tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_5); - __tagHelperExecutionContext.Output = await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); + await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); Instrumentation.BeginContext(443, 45, false); Write(__tagHelperExecutionContext.Output); Instrumentation.EndContext(); diff --git a/test/Microsoft.AspNetCore.Razor.Test/TestFiles/CodeGenerator/Output/DuplicateAttributeTagHelpers.cs b/test/Microsoft.AspNetCore.Razor.Test/TestFiles/CodeGenerator/Output/DuplicateAttributeTagHelpers.cs index 130c427d69..63a2993bff 100644 --- a/test/Microsoft.AspNetCore.Razor.Test/TestFiles/CodeGenerator/Output/DuplicateAttributeTagHelpers.cs +++ b/test/Microsoft.AspNetCore.Razor.Test/TestFiles/CodeGenerator/Output/DuplicateAttributeTagHelpers.cs @@ -48,7 +48,7 @@ namespace TestOutput __tagHelperExecutionContext.AddTagHelperAttribute("type", __TestNamespace_InputTagHelper.Type); __TestNamespace_InputTagHelper2.Type = __TestNamespace_InputTagHelper.Type; __tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_2); - __tagHelperExecutionContext.Output = await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); + await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); Instrumentation.BeginContext(69, 39, false); Write(__tagHelperExecutionContext.Output); Instrumentation.EndContext(); @@ -74,7 +74,7 @@ __TestNamespace_InputTagHelper2.Checked = true; __tagHelperExecutionContext.AddTagHelperAttribute("checked", __TestNamespace_InputTagHelper2.Checked); __tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_3); __tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_4); - __tagHelperExecutionContext.Output = await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); + await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); Instrumentation.BeginContext(114, 70, false); Write(__tagHelperExecutionContext.Output); Instrumentation.EndContext(); @@ -94,7 +94,7 @@ __TestNamespace_PTagHelper.Age = 3; __tagHelperExecutionContext.AddTagHelperAttribute("age", __TestNamespace_PTagHelper.Age); __tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_0); __tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_1); - __tagHelperExecutionContext.Output = await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); + await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); if (!__tagHelperExecutionContext.Output.IsContentModified) { __tagHelperExecutionContext.Output.Content = await __tagHelperExecutionContext.Output.GetChildContentAsync(); diff --git a/test/Microsoft.AspNetCore.Razor.Test/TestFiles/CodeGenerator/Output/DuplicateTargetTagHelper.cs b/test/Microsoft.AspNetCore.Razor.Test/TestFiles/CodeGenerator/Output/DuplicateTargetTagHelper.cs index d4cc63f6aa..29206f02de 100644 --- a/test/Microsoft.AspNetCore.Razor.Test/TestFiles/CodeGenerator/Output/DuplicateTargetTagHelper.cs +++ b/test/Microsoft.AspNetCore.Razor.Test/TestFiles/CodeGenerator/Output/DuplicateTargetTagHelper.cs @@ -44,7 +44,7 @@ __TestNamespace_InputTagHelper.Checked = true; #line hidden __tagHelperExecutionContext.AddTagHelperAttribute("checked", __TestNamespace_InputTagHelper.Checked); __TestNamespace_CatchAllTagHelper.Checked = __TestNamespace_InputTagHelper.Checked; - __tagHelperExecutionContext.Output = await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); + await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); Instrumentation.BeginContext(33, 40, false); Write(__tagHelperExecutionContext.Output); Instrumentation.EndContext(); diff --git a/test/Microsoft.AspNetCore.Razor.Test/TestFiles/CodeGenerator/Output/DynamicAttributeTagHelpers.cs b/test/Microsoft.AspNetCore.Razor.Test/TestFiles/CodeGenerator/Output/DynamicAttributeTagHelpers.cs index 06636b2ffb..e490ed94c4 100644 --- a/test/Microsoft.AspNetCore.Razor.Test/TestFiles/CodeGenerator/Output/DynamicAttributeTagHelpers.cs +++ b/test/Microsoft.AspNetCore.Razor.Test/TestFiles/CodeGenerator/Output/DynamicAttributeTagHelpers.cs @@ -39,7 +39,7 @@ AddHtmlAttributeValue(" ", 55, DateTime.Now, 56, 14, false); #line default #line hidden EndAddHtmlAttributeValues(__tagHelperExecutionContext); - __tagHelperExecutionContext.Output = await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); + await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); Instrumentation.BeginContext(33, 40, false); Write(__tagHelperExecutionContext.Output); Instrumentation.EndContext(); @@ -90,7 +90,7 @@ WriteTo(__razor_attribute_value_writer, string.Empty); ), 93, 44, false); AddHtmlAttributeValue(" ", 137, "suffix", 138, 7, true); EndAddHtmlAttributeValues(__tagHelperExecutionContext); - __tagHelperExecutionContext.Output = await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); + await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); Instrumentation.BeginContext(77, 71, false); Write(__tagHelperExecutionContext.Output); Instrumentation.EndContext(); @@ -123,7 +123,7 @@ AddHtmlAttributeValue(" ", 210, DateTime.Now, 211, 14, false); #line hidden AddHtmlAttributeValue(" ", 224, "suffix", 225, 7, true); EndAddHtmlAttributeValues(__tagHelperExecutionContext); - __tagHelperExecutionContext.Output = await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); + await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); Instrumentation.BeginContext(152, 83, false); Write(__tagHelperExecutionContext.Output); Instrumentation.EndContext(); @@ -227,7 +227,7 @@ AddHtmlAttributeValue(" ", 404, int.MaxValue, 405, 14, false); #line default #line hidden EndAddHtmlAttributeValues(__tagHelperExecutionContext); - __tagHelperExecutionContext.Output = await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); + await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); Instrumentation.BeginContext(239, 183, false); Write(__tagHelperExecutionContext.Output); Instrumentation.EndContext(); @@ -259,7 +259,7 @@ AddHtmlAttributeValue(" ", 488, int.MaxValue, 489, 14, false); #line default #line hidden EndAddHtmlAttributeValues(__tagHelperExecutionContext); - __tagHelperExecutionContext.Output = await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); + await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); Instrumentation.BeginContext(426, 80, false); Write(__tagHelperExecutionContext.Output); Instrumentation.EndContext(); @@ -309,7 +309,7 @@ WriteTo(__razor_attribute_value_writer, string.Empty); } ), 526, 44, false); EndAddHtmlAttributeValues(__tagHelperExecutionContext); - __tagHelperExecutionContext.Output = await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); + await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); Instrumentation.BeginContext(510, 64, false); Write(__tagHelperExecutionContext.Output); Instrumentation.EndContext(); diff --git a/test/Microsoft.AspNetCore.Razor.Test/TestFiles/CodeGenerator/Output/EmptyAttributeTagHelpers.cs b/test/Microsoft.AspNetCore.Razor.Test/TestFiles/CodeGenerator/Output/EmptyAttributeTagHelpers.cs index e3ff471b1c..dcd84747ed 100644 --- a/test/Microsoft.AspNetCore.Razor.Test/TestFiles/CodeGenerator/Output/EmptyAttributeTagHelpers.cs +++ b/test/Microsoft.AspNetCore.Razor.Test/TestFiles/CodeGenerator/Output/EmptyAttributeTagHelpers.cs @@ -46,7 +46,7 @@ __TestNamespace_InputTagHelper2.Checked = ; #line hidden __tagHelperExecutionContext.AddTagHelperAttribute("checked", __TestNamespace_InputTagHelper2.Checked); __tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_0); - __tagHelperExecutionContext.Output = await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); + await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); Instrumentation.BeginContext(38, 34, false); Write(__tagHelperExecutionContext.Output); Instrumentation.EndContext(); @@ -75,7 +75,7 @@ __TestNamespace_InputTagHelper2.Checked = ; #line hidden __tagHelperExecutionContext.AddTagHelperAttribute("checked", __TestNamespace_InputTagHelper2.Checked); __tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_0); - __tagHelperExecutionContext.Output = await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); + await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); Instrumentation.BeginContext(98, 34, false); Write(__tagHelperExecutionContext.Output); Instrumentation.EndContext(); @@ -93,7 +93,7 @@ __TestNamespace_PTagHelper.Age = ; #line default #line hidden __tagHelperExecutionContext.AddTagHelperAttribute("age", __TestNamespace_PTagHelper.Age); - __tagHelperExecutionContext.Output = await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); + await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); if (!__tagHelperExecutionContext.Output.IsContentModified) { __tagHelperExecutionContext.Output.Content = await __tagHelperExecutionContext.Output.GetChildContentAsync(); diff --git a/test/Microsoft.AspNetCore.Razor.Test/TestFiles/CodeGenerator/Output/EnumTagHelpers.cs b/test/Microsoft.AspNetCore.Razor.Test/TestFiles/CodeGenerator/Output/EnumTagHelpers.cs index ae95703aff..1653b925ae 100644 --- a/test/Microsoft.AspNetCore.Razor.Test/TestFiles/CodeGenerator/Output/EnumTagHelpers.cs +++ b/test/Microsoft.AspNetCore.Razor.Test/TestFiles/CodeGenerator/Output/EnumTagHelpers.cs @@ -50,7 +50,7 @@ __TestNamespace_InputTagHelper.Value = MyEnum.MyValue; #line default #line hidden __tagHelperExecutionContext.AddTagHelperAttribute("value", __TestNamespace_InputTagHelper.Value); - __tagHelperExecutionContext.Output = await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); + await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); Instrumentation.BeginContext(79, 33, false); Write(__tagHelperExecutionContext.Output); Instrumentation.EndContext(); @@ -72,7 +72,7 @@ AddHtmlAttributeValue("", 128, MyEnum.MySecondValue, 128, 21, false); #line default #line hidden EndAddHtmlAttributeValues(__tagHelperExecutionContext); - __tagHelperExecutionContext.Output = await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); + await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); Instrumentation.BeginContext(114, 39, false); Write(__tagHelperExecutionContext.Output); Instrumentation.EndContext(); @@ -93,7 +93,7 @@ __TestNamespace_InputTagHelper.Value = global::Microsoft.AspNetCore.Razor.Test.G #line default #line hidden __tagHelperExecutionContext.AddTagHelperAttribute("value", __TestNamespace_InputTagHelper.Value); - __tagHelperExecutionContext.Output = await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); + await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); Instrumentation.BeginContext(155, 25, false); Write(__tagHelperExecutionContext.Output); Instrumentation.EndContext(); @@ -120,7 +120,7 @@ __TestNamespace_CatchAllTagHelper.CatchAll = global::Microsoft.AspNetCore.Razor. #line default #line hidden __tagHelperExecutionContext.AddTagHelperAttribute("catch-all", __TestNamespace_CatchAllTagHelper.CatchAll); - __tagHelperExecutionContext.Output = await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); + await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); Instrumentation.BeginContext(182, 50, false); Write(__tagHelperExecutionContext.Output); Instrumentation.EndContext(); @@ -147,7 +147,7 @@ __TestNamespace_CatchAllTagHelper.CatchAll = enumValue; #line default #line hidden __tagHelperExecutionContext.AddTagHelperAttribute("catch-all", __TestNamespace_CatchAllTagHelper.CatchAll); - __tagHelperExecutionContext.Output = await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); + await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); Instrumentation.BeginContext(234, 51, false); Write(__tagHelperExecutionContext.Output); Instrumentation.EndContext(); diff --git a/test/Microsoft.AspNetCore.Razor.Test/TestFiles/CodeGenerator/Output/EscapedTagHelpers.cs b/test/Microsoft.AspNetCore.Razor.Test/TestFiles/CodeGenerator/Output/EscapedTagHelpers.cs index f400f4d3d6..d4c9c88840 100644 --- a/test/Microsoft.AspNetCore.Razor.Test/TestFiles/CodeGenerator/Output/EscapedTagHelpers.cs +++ b/test/Microsoft.AspNetCore.Razor.Test/TestFiles/CodeGenerator/Output/EscapedTagHelpers.cs @@ -60,7 +60,7 @@ namespace TestOutput #line default #line hidden __tagHelperExecutionContext.AddTagHelperAttribute("checked", __TestNamespace_InputTagHelper2.Checked); - __tagHelperExecutionContext.Output = await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); + await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); Instrumentation.BeginContext(184, 45, false); Write(__tagHelperExecutionContext.Output); Instrumentation.EndContext(); diff --git a/test/Microsoft.AspNetCore.Razor.Test/TestFiles/CodeGenerator/Output/IncompleteTagHelper.cs b/test/Microsoft.AspNetCore.Razor.Test/TestFiles/CodeGenerator/Output/IncompleteTagHelper.cs index a7c06c8cbe..6c5ba5eb91 100644 --- a/test/Microsoft.AspNetCore.Razor.Test/TestFiles/CodeGenerator/Output/IncompleteTagHelper.cs +++ b/test/Microsoft.AspNetCore.Razor.Test/TestFiles/CodeGenerator/Output/IncompleteTagHelper.cs @@ -33,7 +33,7 @@ namespace TestOutput __TestNamespace_PTagHelper = CreateTagHelper(); __tagHelperExecutionContext.Add(__TestNamespace_PTagHelper); __tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_0); - __tagHelperExecutionContext.Output = await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); + await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); Instrumentation.BeginContext(33, 10, false); Write(__tagHelperExecutionContext.Output); Instrumentation.EndContext(); diff --git a/test/Microsoft.AspNetCore.Razor.Test/TestFiles/CodeGenerator/Output/MinimizedTagHelpers.cs b/test/Microsoft.AspNetCore.Razor.Test/TestFiles/CodeGenerator/Output/MinimizedTagHelpers.cs index 3d6587330e..13a263c3e0 100644 --- a/test/Microsoft.AspNetCore.Razor.Test/TestFiles/CodeGenerator/Output/MinimizedTagHelpers.cs +++ b/test/Microsoft.AspNetCore.Razor.Test/TestFiles/CodeGenerator/Output/MinimizedTagHelpers.cs @@ -43,7 +43,7 @@ namespace TestOutput __tagHelperExecutionContext.Add(__TestNamespace_CatchAllTagHelper); __tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_1); __tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_0); - __tagHelperExecutionContext.Output = await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); + await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); Instrumentation.BeginContext(96, 59, false); Write(__tagHelperExecutionContext.Output); Instrumentation.EndContext(); @@ -63,7 +63,7 @@ namespace TestOutput __tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_2); __TestNamespace_InputTagHelper.BoundRequiredString = "hello"; __tagHelperExecutionContext.AddTagHelperAttribute("input-bound-required-string", __TestNamespace_InputTagHelper.BoundRequiredString); - __tagHelperExecutionContext.Output = await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); + await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); Instrumentation.BeginContext(161, 119, false); Write(__tagHelperExecutionContext.Output); Instrumentation.EndContext(); @@ -85,7 +85,7 @@ namespace TestOutput __tagHelperExecutionContext.AddTagHelperAttribute("catchall-bound-string", __TestNamespace_CatchAllTagHelper.BoundRequiredString); __TestNamespace_InputTagHelper.BoundRequiredString = "hello2"; __tagHelperExecutionContext.AddTagHelperAttribute("input-bound-required-string", __TestNamespace_InputTagHelper.BoundRequiredString); - __tagHelperExecutionContext.Output = await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); + await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); Instrumentation.BeginContext(286, 176, false); Write(__tagHelperExecutionContext.Output); Instrumentation.EndContext(); @@ -106,7 +106,7 @@ namespace TestOutput __tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_0); __TestNamespace_InputTagHelper.BoundRequiredString = "world"; __tagHelperExecutionContext.AddTagHelperAttribute("input-bound-required-string", __TestNamespace_InputTagHelper.BoundRequiredString); - __tagHelperExecutionContext.Output = await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); + await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); Instrumentation.BeginContext(468, 206, false); Write(__tagHelperExecutionContext.Output); Instrumentation.EndContext(); @@ -119,7 +119,7 @@ namespace TestOutput __TestNamespace_CatchAllTagHelper = CreateTagHelper(); __tagHelperExecutionContext.Add(__TestNamespace_CatchAllTagHelper); __tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_0); - __tagHelperExecutionContext.Output = await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); + await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); if (!__tagHelperExecutionContext.Output.IsContentModified) { __tagHelperExecutionContext.Output.Content = await __tagHelperExecutionContext.Output.GetChildContentAsync(); diff --git a/test/Microsoft.AspNetCore.Razor.Test/TestFiles/CodeGenerator/Output/NestedScriptTagTagHelpers.cs b/test/Microsoft.AspNetCore.Razor.Test/TestFiles/CodeGenerator/Output/NestedScriptTagTagHelpers.cs index b639ccffae..edb8e513c5 100644 --- a/test/Microsoft.AspNetCore.Razor.Test/TestFiles/CodeGenerator/Output/NestedScriptTagTagHelpers.cs +++ b/test/Microsoft.AspNetCore.Razor.Test/TestFiles/CodeGenerator/Output/NestedScriptTagTagHelpers.cs @@ -75,7 +75,7 @@ namespace TestOutput #line default #line hidden __tagHelperExecutionContext.AddTagHelperAttribute("checked", __TestNamespace_InputTagHelper2.Checked); - __tagHelperExecutionContext.Output = await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); + await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); Instrumentation.BeginContext(307, 86, false); Write(__tagHelperExecutionContext.Output); Instrumentation.EndContext(); @@ -98,7 +98,7 @@ namespace TestOutput __tagHelperExecutionContext.Add(__TestNamespace_PTagHelper); __tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_0); __tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_1); - __tagHelperExecutionContext.Output = await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); + await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); if (!__tagHelperExecutionContext.Output.IsContentModified) { __tagHelperExecutionContext.Output.Content = await __tagHelperExecutionContext.Output.GetChildContentAsync(); diff --git a/test/Microsoft.AspNetCore.Razor.Test/TestFiles/CodeGenerator/Output/PrefixedAttributeTagHelpers.Reversed.cs b/test/Microsoft.AspNetCore.Razor.Test/TestFiles/CodeGenerator/Output/PrefixedAttributeTagHelpers.Reversed.cs index 786e9f8e38..6849c67323 100644 --- a/test/Microsoft.AspNetCore.Razor.Test/TestFiles/CodeGenerator/Output/PrefixedAttributeTagHelpers.Reversed.cs +++ b/test/Microsoft.AspNetCore.Razor.Test/TestFiles/CodeGenerator/Output/PrefixedAttributeTagHelpers.Reversed.cs @@ -71,7 +71,7 @@ __TestNamespace_InputTagHelper2.IntDictionaryProperty = intDictionary; #line hidden __tagHelperExecutionContext.AddTagHelperAttribute("string-dictionary", __TestNamespace_InputTagHelper2.StringDictionaryProperty); __TestNamespace_InputTagHelper1.StringDictionaryProperty = __TestNamespace_InputTagHelper2.StringDictionaryProperty; - __tagHelperExecutionContext.Output = await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); + await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); Instrumentation.BeginContext(329, 92, false); Write(__tagHelperExecutionContext.Output); Instrumentation.EndContext(); @@ -116,7 +116,7 @@ __TestNamespace_InputTagHelper2.IntDictionaryProperty = intDictionary; #line hidden __tagHelperExecutionContext.AddTagHelperAttribute("int-prefix-grabber", __TestNamespace_InputTagHelper2.IntDictionaryProperty["grabber"]); __TestNamespace_InputTagHelper1.IntProperty = __TestNamespace_InputTagHelper2.IntDictionaryProperty["grabber"]; - __tagHelperExecutionContext.Output = await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); + await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); Instrumentation.BeginContext(427, 103, false); Write(__tagHelperExecutionContext.Output); Instrumentation.EndContext(); @@ -188,7 +188,7 @@ __TestNamespace_InputTagHelper2.IntDictionaryProperty["salt"] = 37; __TestNamespace_InputTagHelper2.StringDictionaryProperty["cumin"] = __tagHelperStringValueBuffer.GetContent(HtmlEncoder); __tagHelperExecutionContext.AddTagHelperAttribute("string-prefix-cumin", __TestNamespace_InputTagHelper2.StringDictionaryProperty["cumin"]); __TestNamespace_InputTagHelper1.StringDictionaryProperty["cumin"] = __TestNamespace_InputTagHelper2.StringDictionaryProperty["cumin"]; - __tagHelperExecutionContext.Output = await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); + await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); Instrumentation.BeginContext(536, 257, false); Write(__tagHelperExecutionContext.Output); Instrumentation.EndContext(); @@ -229,7 +229,7 @@ __TestNamespace_InputTagHelper2.IntDictionaryProperty["value"] = 37; __TestNamespace_InputTagHelper2.StringDictionaryProperty["thyme"] = "string"; __tagHelperExecutionContext.AddTagHelperAttribute("string-prefix-thyme", __TestNamespace_InputTagHelper2.StringDictionaryProperty["thyme"]); __TestNamespace_InputTagHelper1.StringDictionaryProperty["thyme"] = __TestNamespace_InputTagHelper2.StringDictionaryProperty["thyme"]; - __tagHelperExecutionContext.Output = await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); + await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); Instrumentation.BeginContext(799, 60, false); Write(__tagHelperExecutionContext.Output); Instrumentation.EndContext(); diff --git a/test/Microsoft.AspNetCore.Razor.Test/TestFiles/CodeGenerator/Output/PrefixedAttributeTagHelpers.cs b/test/Microsoft.AspNetCore.Razor.Test/TestFiles/CodeGenerator/Output/PrefixedAttributeTagHelpers.cs index d21792ab29..b265168668 100644 --- a/test/Microsoft.AspNetCore.Razor.Test/TestFiles/CodeGenerator/Output/PrefixedAttributeTagHelpers.cs +++ b/test/Microsoft.AspNetCore.Razor.Test/TestFiles/CodeGenerator/Output/PrefixedAttributeTagHelpers.cs @@ -71,7 +71,7 @@ __TestNamespace_InputTagHelper1.IntDictionaryProperty = intDictionary; #line hidden __tagHelperExecutionContext.AddTagHelperAttribute("string-dictionary", __TestNamespace_InputTagHelper1.StringDictionaryProperty); __TestNamespace_InputTagHelper2.StringDictionaryProperty = __TestNamespace_InputTagHelper1.StringDictionaryProperty; - __tagHelperExecutionContext.Output = await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); + await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); Instrumentation.BeginContext(329, 92, false); Write(__tagHelperExecutionContext.Output); Instrumentation.EndContext(); @@ -116,7 +116,7 @@ __TestNamespace_InputTagHelper1.IntDictionaryProperty = intDictionary; #line hidden __tagHelperExecutionContext.AddTagHelperAttribute("int-prefix-grabber", __TestNamespace_InputTagHelper1.IntProperty); __TestNamespace_InputTagHelper2.IntDictionaryProperty["grabber"] = __TestNamespace_InputTagHelper1.IntProperty; - __tagHelperExecutionContext.Output = await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); + await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); Instrumentation.BeginContext(427, 103, false); Write(__tagHelperExecutionContext.Output); Instrumentation.EndContext(); @@ -188,7 +188,7 @@ __TestNamespace_InputTagHelper1.IntDictionaryProperty["salt"] = 37; __TestNamespace_InputTagHelper1.StringDictionaryProperty["cumin"] = __tagHelperStringValueBuffer.GetContent(HtmlEncoder); __tagHelperExecutionContext.AddTagHelperAttribute("string-prefix-cumin", __TestNamespace_InputTagHelper1.StringDictionaryProperty["cumin"]); __TestNamespace_InputTagHelper2.StringDictionaryProperty["cumin"] = __TestNamespace_InputTagHelper1.StringDictionaryProperty["cumin"]; - __tagHelperExecutionContext.Output = await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); + await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); Instrumentation.BeginContext(536, 257, false); Write(__tagHelperExecutionContext.Output); Instrumentation.EndContext(); @@ -229,7 +229,7 @@ __TestNamespace_InputTagHelper1.IntDictionaryProperty["value"] = 37; __TestNamespace_InputTagHelper1.StringDictionaryProperty["thyme"] = "string"; __tagHelperExecutionContext.AddTagHelperAttribute("string-prefix-thyme", __TestNamespace_InputTagHelper1.StringDictionaryProperty["thyme"]); __TestNamespace_InputTagHelper2.StringDictionaryProperty["thyme"] = __TestNamespace_InputTagHelper1.StringDictionaryProperty["thyme"]; - __tagHelperExecutionContext.Output = await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); + await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); Instrumentation.BeginContext(799, 60, false); Write(__tagHelperExecutionContext.Output); Instrumentation.EndContext(); diff --git a/test/Microsoft.AspNetCore.Razor.Test/TestFiles/CodeGenerator/Output/SingleTagHelper.cs b/test/Microsoft.AspNetCore.Razor.Test/TestFiles/CodeGenerator/Output/SingleTagHelper.cs index b88c512ce1..0c08dee9fa 100644 --- a/test/Microsoft.AspNetCore.Razor.Test/TestFiles/CodeGenerator/Output/SingleTagHelper.cs +++ b/test/Microsoft.AspNetCore.Razor.Test/TestFiles/CodeGenerator/Output/SingleTagHelper.cs @@ -42,7 +42,7 @@ __TestNamespace_PTagHelper.Age = 1337; #line default #line hidden __tagHelperExecutionContext.AddTagHelperAttribute("age", __TestNamespace_PTagHelper.Age); - __tagHelperExecutionContext.Output = await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); + await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); if (!__tagHelperExecutionContext.Output.IsContentModified) { __tagHelperExecutionContext.Output.Content = await __tagHelperExecutionContext.Output.GetChildContentAsync(); diff --git a/test/Microsoft.AspNetCore.Razor.Test/TestFiles/CodeGenerator/Output/SingleTagHelperWithNewlineBeforeAttributes.cs b/test/Microsoft.AspNetCore.Razor.Test/TestFiles/CodeGenerator/Output/SingleTagHelperWithNewlineBeforeAttributes.cs index dbfcb79b65..44dfeb7838 100644 --- a/test/Microsoft.AspNetCore.Razor.Test/TestFiles/CodeGenerator/Output/SingleTagHelperWithNewlineBeforeAttributes.cs +++ b/test/Microsoft.AspNetCore.Razor.Test/TestFiles/CodeGenerator/Output/SingleTagHelperWithNewlineBeforeAttributes.cs @@ -42,7 +42,7 @@ __TestNamespace_PTagHelper.Age = 1337; #line default #line hidden __tagHelperExecutionContext.AddTagHelperAttribute("age", __TestNamespace_PTagHelper.Age); - __tagHelperExecutionContext.Output = await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); + await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); if (!__tagHelperExecutionContext.Output.IsContentModified) { __tagHelperExecutionContext.Output.Content = await __tagHelperExecutionContext.Output.GetChildContentAsync(); diff --git a/test/Microsoft.AspNetCore.Razor.Test/TestFiles/CodeGenerator/Output/SymbolBoundAttributes.cs b/test/Microsoft.AspNetCore.Razor.Test/TestFiles/CodeGenerator/Output/SymbolBoundAttributes.cs index cf7ebab0f0..57ce9959e2 100644 --- a/test/Microsoft.AspNetCore.Razor.Test/TestFiles/CodeGenerator/Output/SymbolBoundAttributes.cs +++ b/test/Microsoft.AspNetCore.Razor.Test/TestFiles/CodeGenerator/Output/SymbolBoundAttributes.cs @@ -47,7 +47,7 @@ __TestNamespace_CatchAllTagHelper.ListItems = items; #line hidden __tagHelperExecutionContext.AddTagHelperAttribute("[item]", __TestNamespace_CatchAllTagHelper.ListItems); __tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_1); - __tagHelperExecutionContext.Output = await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); + await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); Instrumentation.BeginContext(276, 45, false); Write(__tagHelperExecutionContext.Output); Instrumentation.EndContext(); @@ -68,7 +68,7 @@ __TestNamespace_CatchAllTagHelper.ArrayItems = items; #line hidden __tagHelperExecutionContext.AddTagHelperAttribute("[(item)]", __TestNamespace_CatchAllTagHelper.ArrayItems); __tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_2); - __tagHelperExecutionContext.Output = await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); + await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); Instrumentation.BeginContext(323, 49, false); Write(__tagHelperExecutionContext.Output); Instrumentation.EndContext(); @@ -92,7 +92,7 @@ __TestNamespace_CatchAllTagHelper.Event1 = doSomething(); #line hidden __tagHelperExecutionContext.AddTagHelperAttribute("(click)", __TestNamespace_CatchAllTagHelper.Event1); __tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_3); - __tagHelperExecutionContext.Output = await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); + await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); if (!__tagHelperExecutionContext.Output.IsContentModified) { __tagHelperExecutionContext.Output.Content = await __tagHelperExecutionContext.Output.GetChildContentAsync(); @@ -120,7 +120,7 @@ __TestNamespace_CatchAllTagHelper.Event2 = doSomething(); #line hidden __tagHelperExecutionContext.AddTagHelperAttribute("(^click)", __TestNamespace_CatchAllTagHelper.Event2); __tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_4); - __tagHelperExecutionContext.Output = await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); + await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); if (!__tagHelperExecutionContext.Output.IsContentModified) { __tagHelperExecutionContext.Output.Content = await __tagHelperExecutionContext.Output.GetChildContentAsync(); @@ -144,7 +144,7 @@ __TestNamespace_CatchAllTagHelper.Event2 = doSomething(); __TestNamespace_CatchAllTagHelper.StringProperty1 = "value"; __tagHelperExecutionContext.AddTagHelperAttribute("*something", __TestNamespace_CatchAllTagHelper.StringProperty1); __tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_5); - __tagHelperExecutionContext.Output = await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); + await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); if (!__tagHelperExecutionContext.Output.IsContentModified) { __tagHelperExecutionContext.Output.Content = await __tagHelperExecutionContext.Output.GetChildContentAsync(); @@ -163,7 +163,7 @@ __TestNamespace_CatchAllTagHelper.Event2 = doSomething(); __tagHelperExecutionContext.Add(__TestNamespace_CatchAllTagHelper); __tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_0); __tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_6); - __tagHelperExecutionContext.Output = await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); + await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); Instrumentation.BeginContext(607, 33, false); Write(__tagHelperExecutionContext.Output); Instrumentation.EndContext(); @@ -180,7 +180,7 @@ __TestNamespace_CatchAllTagHelper.Event2 = doSomething(); __TestNamespace_CatchAllTagHelper.StringProperty2 = "value"; __tagHelperExecutionContext.AddTagHelperAttribute("#local", __TestNamespace_CatchAllTagHelper.StringProperty2); __tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_7); - __tagHelperExecutionContext.Output = await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); + await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); Instrumentation.BeginContext(642, 47, false); Write(__tagHelperExecutionContext.Output); Instrumentation.EndContext(); diff --git a/test/Microsoft.AspNetCore.Razor.Test/TestFiles/CodeGenerator/Output/TagHelpersInSection.cs b/test/Microsoft.AspNetCore.Razor.Test/TestFiles/CodeGenerator/Output/TagHelpersInSection.cs index ae13a380f8..b8aadb20ef 100644 --- a/test/Microsoft.AspNetCore.Razor.Test/TestFiles/CodeGenerator/Output/TagHelpersInSection.cs +++ b/test/Microsoft.AspNetCore.Razor.Test/TestFiles/CodeGenerator/Output/TagHelpersInSection.cs @@ -60,7 +60,7 @@ namespace TestOutput , StartTagHelperWritingScope, EndTagHelperWritingScope); __TestNamespace_NestedTagHelper = CreateTagHelper(); __tagHelperExecutionContext.Add(__TestNamespace_NestedTagHelper); - __tagHelperExecutionContext.Output = await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); + await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); if (!__tagHelperExecutionContext.Output.IsContentModified) { __tagHelperExecutionContext.Output.Content = await __tagHelperExecutionContext.Output.GetChildContentAsync(); @@ -95,7 +95,7 @@ AddHtmlAttributeValue(" ", 199, DateTime.Now, 200, 14, false); #line default #line hidden EndAddHtmlAttributeValues(__tagHelperExecutionContext); - __tagHelperExecutionContext.Output = await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); + await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); if (!__tagHelperExecutionContext.Output.IsContentModified) { __tagHelperExecutionContext.Output.Content = await __tagHelperExecutionContext.Output.GetChildContentAsync(); diff --git a/test/Microsoft.AspNetCore.Razor.Test/TestFiles/CodeGenerator/Output/TagHelpersWithWeirdlySpacedAttributes.cs b/test/Microsoft.AspNetCore.Razor.Test/TestFiles/CodeGenerator/Output/TagHelpersWithWeirdlySpacedAttributes.cs index 40a8d8b70c..d1bfbb3299 100644 --- a/test/Microsoft.AspNetCore.Razor.Test/TestFiles/CodeGenerator/Output/TagHelpersWithWeirdlySpacedAttributes.cs +++ b/test/Microsoft.AspNetCore.Razor.Test/TestFiles/CodeGenerator/Output/TagHelpersWithWeirdlySpacedAttributes.cs @@ -55,7 +55,7 @@ __TestNamespace_PTagHelper.Age = 1337; #line hidden __tagHelperStringValueBuffer = EndTagHelperWritingScope(); __tagHelperExecutionContext.AddHtmlAttribute("data-content", Html.Raw(__tagHelperStringValueBuffer.GetContent(HtmlEncoder))); - __tagHelperExecutionContext.Output = await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); + await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); if (!__tagHelperExecutionContext.Output.IsContentModified) { __tagHelperExecutionContext.Output.Content = await __tagHelperExecutionContext.Output.GetChildContentAsync(); @@ -78,7 +78,7 @@ __TestNamespace_PTagHelper.Age = 1337; __tagHelperExecutionContext.AddTagHelperAttribute("type", __TestNamespace_InputTagHelper.Type); __TestNamespace_InputTagHelper2.Type = __TestNamespace_InputTagHelper.Type; __tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_1); - __tagHelperExecutionContext.Output = await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); + await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); Instrumentation.BeginContext(122, 47, false); Write(__tagHelperExecutionContext.Output); Instrumentation.EndContext(); @@ -98,7 +98,7 @@ __TestNamespace_PTagHelper.Age = 1234; #line hidden __tagHelperExecutionContext.AddTagHelperAttribute("age", __TestNamespace_PTagHelper.Age); __tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_2); - __tagHelperExecutionContext.Output = await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); + await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); Instrumentation.BeginContext(173, 46, false); Write(__tagHelperExecutionContext.Output); Instrumentation.EndContext(); @@ -117,7 +117,7 @@ __TestNamespace_PTagHelper.Age = 1234; __tagHelperExecutionContext.AddTagHelperAttribute("type", __TestNamespace_InputTagHelper.Type); __TestNamespace_InputTagHelper2.Type = __TestNamespace_InputTagHelper.Type; __tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_3); - __tagHelperExecutionContext.Output = await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); + await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); Instrumentation.BeginContext(223, 51, false); Write(__tagHelperExecutionContext.Output); Instrumentation.EndContext(); diff --git a/test/Microsoft.AspNetCore.Razor.Test/TestFiles/CodeGenerator/Output/TransitionsInTagHelperAttributes.cs b/test/Microsoft.AspNetCore.Razor.Test/TestFiles/CodeGenerator/Output/TransitionsInTagHelperAttributes.cs index 1c552f9c7f..765d661782 100644 --- a/test/Microsoft.AspNetCore.Razor.Test/TestFiles/CodeGenerator/Output/TransitionsInTagHelperAttributes.cs +++ b/test/Microsoft.AspNetCore.Razor.Test/TestFiles/CodeGenerator/Output/TransitionsInTagHelperAttributes.cs @@ -54,7 +54,7 @@ __TestNamespace_PTagHelper.Age = 1337; #line default #line hidden __tagHelperExecutionContext.AddTagHelperAttribute("age", __TestNamespace_PTagHelper.Age); - __tagHelperExecutionContext.Output = await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); + await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); if (!__tagHelperExecutionContext.Output.IsContentModified) { __tagHelperExecutionContext.Output.Content = await __tagHelperExecutionContext.Output.GetChildContentAsync(); @@ -84,7 +84,7 @@ __TestNamespace_PTagHelper.Age = 42; #line default #line hidden __tagHelperExecutionContext.AddTagHelperAttribute("age", __TestNamespace_PTagHelper.Age); - __tagHelperExecutionContext.Output = await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); + await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); Instrumentation.BeginContext(143, 34, false); Write(__tagHelperExecutionContext.Output); Instrumentation.EndContext(); @@ -104,7 +104,7 @@ __TestNamespace_PTagHelper.Age = 42 + @int; #line default #line hidden __tagHelperExecutionContext.AddTagHelperAttribute("age", __TestNamespace_PTagHelper.Age); - __tagHelperExecutionContext.Output = await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); + await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); Instrumentation.BeginContext(179, 36, false); Write(__tagHelperExecutionContext.Output); Instrumentation.EndContext(); @@ -124,7 +124,7 @@ __TestNamespace_PTagHelper.Age = int; #line default #line hidden __tagHelperExecutionContext.AddTagHelperAttribute("age", __TestNamespace_PTagHelper.Age); - __tagHelperExecutionContext.Output = await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); + await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); Instrumentation.BeginContext(217, 31, false); Write(__tagHelperExecutionContext.Output); Instrumentation.EndContext(); @@ -144,7 +144,7 @@ __TestNamespace_PTagHelper.Age = (@int); #line default #line hidden __tagHelperExecutionContext.AddTagHelperAttribute("age", __TestNamespace_PTagHelper.Age); - __tagHelperExecutionContext.Output = await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); + await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); Instrumentation.BeginContext(250, 34, false); Write(__tagHelperExecutionContext.Output); Instrumentation.EndContext(); @@ -171,7 +171,7 @@ __TestNamespace_PTagHelper.Age = 4 * @(@int + 2); #line default #line hidden __tagHelperExecutionContext.AddTagHelperAttribute("age", __TestNamespace_PTagHelper.Age); - __tagHelperExecutionContext.Output = await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); + await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); Instrumentation.BeginContext(286, 54, false); Write(__tagHelperExecutionContext.Output); Instrumentation.EndContext();