Introducing buffering in TagHelperOutput.PreContent, Content, PostContent.

This commit is contained in:
sornaks 2015-02-23 08:47:26 -08:00
parent 7ecce1b666
commit bd9d57d33e
26 changed files with 1160 additions and 470 deletions

View File

@ -0,0 +1,150 @@
// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System.Collections.Generic;
using System.IO;
using Microsoft.Framework.Internal;
namespace Microsoft.AspNet.Razor.Runtime.TagHelpers
{
/// <summary>
/// Default concrete <see cref="TagHelperContent"/>.
/// </summary>
public class DefaultTagHelperContent : TagHelperContent, ITextWriterCopyable
{
private readonly BufferEntryCollection _buffer;
/// <summary>
/// Instantiates a new instance of <see cref="DefaultTagHelperContent"/>.
/// </summary>
public DefaultTagHelperContent()
{
_buffer = new BufferEntryCollection();
}
/// <inheritdoc />
public override bool IsModified
{
get
{
return _buffer.IsModified;
}
}
/// <inheritdoc />
public override bool IsWhiteSpace
{
get
{
foreach (var value in _buffer)
{
if (!string.IsNullOrWhiteSpace(value))
{
return false;
}
}
return true;
}
}
/// <inheritdoc />
public override bool IsEmpty
{
get
{
foreach (var value in _buffer)
{
if (!string.IsNullOrEmpty(value))
{
return false;
}
}
return true;
}
}
/// <inheritdoc />
public override TagHelperContent SetContent(string value)
{
Clear();
Append(value);
return this;
}
/// <inheritdoc />
public override TagHelperContent SetContent(TagHelperContent tagHelperContent)
{
Clear();
Append(tagHelperContent);
return this;
}
/// <inheritdoc />
public override TagHelperContent Append(string value)
{
_buffer.Add(value);
return this;
}
/// <inheritdoc />
public override TagHelperContent Append(TagHelperContent tagHelperContent)
{
if (tagHelperContent != null)
{
foreach (var value in tagHelperContent)
{
Append(value);
}
}
// If Append() was called with an empty TagHelperContent IsModified should
// still be true. If the content was not already modified, it means it is empty.
// So the Clear() method can be used to indirectly set the IsModified.
if (!IsModified)
{
Clear();
}
return this;
}
/// <inheritdoc />
public override TagHelperContent Clear()
{
_buffer.Clear();
return this;
}
/// <inheritdoc />
public override string GetContent()
{
return string.Join(string.Empty, _buffer);
}
/// <inheritdoc />
public void CopyTo([NotNull] TextWriter writer)
{
foreach (var value in _buffer)
{
writer.Write(value);
}
}
/// <inheritdoc />
public override string ToString()
{
return GetContent();
}
/// <inheritdoc />
public override IEnumerator<string> GetEnumerator()
{
// The enumerator is exposed so that SetContent(TagHelperContent) and Append(TagHelperContent)
// can use this to iterate through the values of the buffer.
return _buffer.GetEnumerator();
}
}
}

View File

@ -0,0 +1,19 @@
// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System.IO;
namespace Microsoft.AspNet.Razor.Runtime.TagHelpers
{
/// <summary>
/// Specifies the contract for copying to a <see cref="TextWriter"/>.
/// </summary>
public interface ITextWriterCopyable
{
/// <summary>
/// Copies to the <paramref name="writer"/>.
/// </summary>
/// <param name="writer">The <see cref="TextWriter"/> target.</param>
void CopyTo(TextWriter writer);
}
}

View File

@ -0,0 +1,78 @@
// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System.Collections;
using System.Collections.Generic;
namespace Microsoft.AspNet.Razor.Runtime.TagHelpers
{
/// <summary>
/// Abstract class used to buffer content returned by <see cref="ITagHelper"/>s.
/// </summary>
public abstract class TagHelperContent : IEnumerable<string>
{
/// <summary>
/// Gets a value indicating whether the content was modifed.
/// </summary>
public abstract bool IsModified { get; }
/// <summary>
/// Gets a value indicating whether the content is empty.
/// </summary>
public abstract bool IsEmpty { get; }
/// <summary>
/// Gets a value indicating whether the content is whitespace.
/// </summary>
public abstract bool IsWhiteSpace { get; }
/// <summary>
/// Sets the content.
/// </summary>
/// <param name="value">The <see cref="string"/> that replaces the content.</param>
/// <returns>A reference to this instance after the set operation has completed.</returns>
public abstract TagHelperContent SetContent(string value);
/// <summary>
/// Sets the content.
/// </summary>
/// <param name="tagHelperContent">The <see cref="TagHelperContent"/> that replaces the content.</param>
/// <returns>A reference to this instance after the set operation has completed.</returns>
public abstract TagHelperContent SetContent(TagHelperContent tagHelperContent);
/// <summary>
/// Appends <paramref name="value"/> to the existing content.
/// </summary>
/// <param name="value">The <see cref="string"/> to be appended.</param>
/// <returns>A reference to this instance after the append operation has completed.</returns>
public abstract TagHelperContent Append(string value);
/// <summary>
/// Appends <paramref name="tagHelperContent"/> to the existing content.
/// </summary>
/// <param name="tagHelperContent">The <see cref="TagHelperContent"/> to be appended.</param>
/// <returns>A reference to this instance after the append operation has completed.</returns>
public abstract TagHelperContent Append(TagHelperContent tagHelperContent);
/// <summary>
/// Clears the content.
/// </summary>
/// <returns>A reference to this instance after the clear operation has completed.</returns>
public abstract TagHelperContent Clear();
/// <summary>
/// Gets the content.
/// </summary>
/// <returns>A <see cref="string"/> containing the content.</returns>
public abstract string GetContent();
/// <inheritdoc />
public abstract IEnumerator<string> GetEnumerator();
/// <inheritdoc />
IEnumerator IEnumerable.GetEnumerator()
{
return GetEnumerator();
}
}
}

View File

@ -13,7 +13,7 @@ namespace Microsoft.AspNet.Razor.Runtime.TagHelpers
/// </summary>
public class TagHelperContext
{
private readonly Func<Task<string>> _getChildContentAsync;
private readonly Func<Task<TagHelperContent>> _getChildContentAsync;
/// <summary>
/// Instantiates a new <see cref="TagHelperContext"/>.
@ -28,7 +28,7 @@ namespace Microsoft.AspNet.Razor.Runtime.TagHelpers
[NotNull] IDictionary<string, object> allAttributes,
[NotNull] IDictionary<object, object> items,
[NotNull] string uniqueId,
[NotNull] Func<Task<string>> getChildContentAsync)
[NotNull] Func<Task<TagHelperContent>> getChildContentAsync)
{
AllAttributes = allAttributes;
Items = items;
@ -59,7 +59,7 @@ namespace Microsoft.AspNet.Razor.Runtime.TagHelpers
/// A delegate used to execute and retrieve the rendered child content asynchronously.
/// </summary>
/// <returns>A <see cref="Task"/> that when executed returns content rendered by children.</returns>
public Task<string> GetChildContentAsync()
public Task<TagHelperContent> GetChildContentAsync()
{
return _getChildContentAsync();
}

View File

@ -2,9 +2,7 @@
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System;
using System.Collections;
using System.Collections.Generic;
using System.IO;
using System.Threading.Tasks;
using Microsoft.Framework.Internal;
@ -17,9 +15,9 @@ namespace Microsoft.AspNet.Razor.Runtime.TagHelpers
{
private readonly List<ITagHelper> _tagHelpers;
private readonly Func<Task> _executeChildContentAsync;
private readonly Action _startWritingScope;
private readonly Func<TextWriter> _endWritingScope;
private string _childContent;
private readonly Action _startTagHelperWritingScope;
private readonly Func<TagHelperContent> _endTagHelperWritingScope;
private TagHelperContent _childContent;
/// <summary>
/// Internal for testing purposes only.
@ -30,8 +28,8 @@ namespace Microsoft.AspNet.Razor.Runtime.TagHelpers
items: new Dictionary<object, object>(),
uniqueId: string.Empty,
executeChildContentAsync: async () => await Task.FromResult(result: true),
startWritingScope: () => { },
endWritingScope: () => new StringWriter())
startTagHelperWritingScope: () => { },
endTagHelperWritingScope: () => new DefaultTagHelperContent())
{
}
@ -45,21 +43,21 @@ namespace Microsoft.AspNet.Razor.Runtime.TagHelpers
/// <see cref="ITagHelper"/>s</param>
/// <param name="uniqueId">An identifier unique to the HTML element this context is for.</param>
/// <param name="executeChildContentAsync">A delegate used to execute the child content asynchronously.</param>
/// <param name="startWritingScope">A delegate used to start a writing scope in a Razor page.</param>
/// <param name="endWritingScope">A delegate used to end a writing scope in a Razor page.</param>
/// <param name="startTagHelperWritingScope">A delegate used to start a writing scope in a Razor page.</param>
/// <param name="endTagHelperWritingScope">A delegate used to end a writing scope in a Razor page.</param>
public TagHelperExecutionContext(
[NotNull] string tagName,
bool selfClosing,
[NotNull] IDictionary<object, object> items,
[NotNull] string uniqueId,
[NotNull] Func<Task> executeChildContentAsync,
[NotNull] Action startWritingScope,
[NotNull] Func<TextWriter> endWritingScope)
[NotNull] Action startTagHelperWritingScope,
[NotNull] Func<TagHelperContent> endTagHelperWritingScope)
{
_tagHelpers = new List<ITagHelper>();
_executeChildContentAsync = executeChildContentAsync;
_startWritingScope = startWritingScope;
_endWritingScope = endWritingScope;
_startTagHelperWritingScope = startTagHelperWritingScope;
_endTagHelperWritingScope = endTagHelperWritingScope;
SelfClosing = selfClosing;
AllAttributes = new Dictionary<string, object>(StringComparer.OrdinalIgnoreCase);
@ -171,18 +169,18 @@ namespace Microsoft.AspNet.Razor.Runtime.TagHelpers
/// <returns>A <see cref="Task"/> that on completion returns the rendered child content.</returns>
/// <remarks>
/// Child content is only executed once. Successive calls to this method or successive executions of the
/// returned <see cref="Task{string}"/> return a cached result.
/// returned <see cref="Task{TagHelperContent}"/> return a cached result.
/// </remarks>
public async Task<string> GetChildContentAsync()
public async Task<TagHelperContent> GetChildContentAsync()
{
if (_childContent == null)
{
_startWritingScope();
_startTagHelperWritingScope();
await _executeChildContentAsync();
_childContent = _endWritingScope().ToString();
_childContent = _endTagHelperWritingScope();
}
return _childContent;
return new DefaultTagHelperContent().SetContent(_childContent);
}
}
}

View File

@ -15,17 +15,17 @@ namespace Microsoft.AspNet.Razor.Runtime.TagHelpers
/// </summary>
public class TagHelperOutput
{
private string _content;
private bool _contentSet;
private bool _isTagNameNullOrWhitespace;
private string _tagName;
private readonly IHtmlEncoder _htmlEncoder;
private readonly DefaultTagHelperContent _preContent;
private readonly DefaultTagHelperContent _content;
private readonly DefaultTagHelperContent _postContent;
// Internal for testing
internal TagHelperOutput(string tagName)
: this(tagName, new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase), null)
{
TagName = tagName;
Attributes = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase);
}
/// <summary>
@ -42,9 +42,9 @@ namespace Microsoft.AspNet.Razor.Runtime.TagHelpers
{
TagName = tagName;
Attributes = new Dictionary<string, string>(attributes, StringComparer.OrdinalIgnoreCase);
PreContent = string.Empty;
_content = string.Empty;
PostContent = string.Empty;
_preContent = new DefaultTagHelperContent();
_content = new DefaultTagHelperContent();
_postContent = new DefaultTagHelperContent();
_htmlEncoder = htmlEncoder;
}
@ -71,40 +71,47 @@ namespace Microsoft.AspNet.Razor.Runtime.TagHelpers
/// The HTML element's pre content.
/// </summary>
/// <remarks>Value is prepended to the <see cref="ITagHelper"/>'s final output.</remarks>
public string PreContent { get; set; }
public TagHelperContent PreContent
{
get
{
return _preContent;
}
}
/// <summary>
/// The HTML element's main content.
/// </summary>
/// <remarks>Value occurs in the <see cref="ITagHelper"/>'s final output after <see cref="PreContent"/> and
/// before <see cref="PostContent"/></remarks>
public string Content
public TagHelperContent Content
{
get
{
return _content;
}
set
{
_contentSet = true;
_content = value;
}
}
/// <summary>
/// The HTML element's post content.
/// </summary>
/// <remarks>Value is appended to the <see cref="ITagHelper"/>'s final output.</remarks>
public string PostContent { get; set; }
public TagHelperContent PostContent
{
get
{
return _postContent;
}
}
/// <summary>
/// <c>true</c> if <see cref="Content"/> has been set, <c>false</c> otherwise.
/// </summary>
public bool ContentSet
public bool IsContentModified
{
get
{
return _contentSet;
return Content.IsModified;
}
}
@ -159,46 +166,49 @@ namespace Microsoft.AspNet.Razor.Runtime.TagHelpers
/// <summary>
/// Generates the <see cref="TagHelperOutput"/>'s <see cref="PreContent"/>.
/// </summary>
/// <returns><c>string.Empty</c> if <see cref="TagName"/> is not <c>null</c> or whitespace
/// and <see cref="SelfClosing"/> is <c>true</c>. Otherwise, <see cref="PreContent"/>.</returns>
public string GeneratePreContent()
/// <returns><c>null</c> if <see cref="TagName"/> is not <c>null</c> or whitespace
/// and <see cref="SelfClosing"/> is <c>true</c>.
/// Otherwise, an <see cref="ITextWriterCopyable"/> containing the <see cref="PreContent"/>.</returns>
public ITextWriterCopyable GeneratePreContent()
{
if (!_isTagNameNullOrWhitespace && SelfClosing)
{
return string.Empty;
return null;
}
return PreContent;
return _preContent;
}
/// <summary>
/// Generates the <see cref="TagHelperOutput"/>'s body.
/// </summary>
/// <returns><c>string.Empty</c> if <see cref="TagName"/> is not <c>null</c> or whitespace
/// and <see cref="SelfClosing"/> is <c>true</c>. Otherwise, <see cref="Content"/>.</returns>
public string GenerateContent()
/// <returns><c>null</c> if <see cref="TagName"/> is not <c>null</c> or whitespace
/// and <see cref="SelfClosing"/> is <c>true</c>.
/// Otherwise, an <see cref="ITextWriterCopyable"/> containing the <see cref="Content"/>.</returns>
public ITextWriterCopyable GenerateContent()
{
if (!_isTagNameNullOrWhitespace && SelfClosing)
{
return string.Empty;
return null;
}
return Content;
return _content;
}
/// <summary>
/// Generates the <see cref="TagHelperOutput"/>'s <see cref="PostContent"/>.
/// </summary>
/// <returns><c>string.Empty</c> if <see cref="TagName"/> is not <c>null</c> or whitespace
/// and <see cref="SelfClosing"/> is <c>true</c>. Otherwise, <see cref="PostContent"/>.</returns>
public string GeneratePostContent()
/// <returns><c>null</c> if <see cref="TagName"/> is not <c>null</c> or whitespace
/// and <see cref="SelfClosing"/> is <c>true</c>.
/// Otherwise, an <see cref="ITextWriterCopyable"/> containing the <see cref="PostContent"/>.</returns>
public ITextWriterCopyable GeneratePostContent()
{
if (!_isTagNameNullOrWhitespace && SelfClosing)
{
return string.Empty;
return null;
}
return PostContent;
return _postContent;
}
/// <summary>
@ -220,15 +230,15 @@ namespace Microsoft.AspNet.Razor.Runtime.TagHelpers
/// Changes <see cref="TagHelperOutput"/> to generate nothing.
/// </summary>
/// <remarks>
/// Sets <see cref="TagName"/>, <see cref="PreContent"/>, <see cref="Content"/>, and <see cref="PostContent"/>
/// to <c>null</c> to suppress output.
/// Sets <see cref="TagName"/> to <c>null</c>, and clears <see cref="PreContent"/>, <see cref="Content"/>,
/// and <see cref="PostContent"/> to suppress output.
/// </remarks>
public void SuppressOutput()
{
TagName = null;
PreContent = null;
Content = null;
PostContent = null;
PreContent.Clear();
Content.Clear();
PostContent.Clear();
}
}
}

View File

@ -33,16 +33,16 @@ namespace Microsoft.AspNet.Razor.Runtime.TagHelpers
/// </param>
/// <param name="uniqueId">An identifier unique to the HTML element this scope is for.</param>
/// <param name="executeChildContentAsync">A delegate used to execute the child content asynchronously.</param>
/// <param name="startWritingScope">A delegate used to start a writing scope in a Razor page.</param>
/// <param name="endWritingScope">A delegate used to end a writing scope in a Razor page.</param>
/// <param name="startTagHelperWritingScope">A delegate used to start a writing scope in a Razor page.</param>
/// <param name="endTagHelperWritingScope">A delegate used to end a writing scope in a Razor page.</param>
/// <returns>A <see cref="TagHelperExecutionContext"/> to use.</returns>
public TagHelperExecutionContext Begin(
[NotNull] string tagName,
bool selfClosing,
[NotNull] string uniqueId,
[NotNull] Func<Task> executeChildContentAsync,
[NotNull] Action startWritingScope,
[NotNull] Func<TextWriter> endWritingScope)
[NotNull] Action startTagHelperWritingScope,
[NotNull] Func<TagHelperContent> endTagHelperWritingScope)
{
IDictionary<object, object> items;
@ -64,8 +64,8 @@ namespace Microsoft.AspNet.Razor.Runtime.TagHelpers
items,
uniqueId,
executeChildContentAsync,
startWritingScope,
endWritingScope);
startTagHelperWritingScope,
endTagHelperWritingScope);
_executionScopes.Push(executionContext);

View File

@ -3,6 +3,7 @@
"version": "4.0.0-*",
"dependencies": {
"Microsoft.AspNet.Razor": "4.0.0-*",
"Microsoft.Framework.BufferEntryCollection.Internal": { "type": "build", "version": "1.0.0-*" },
"Microsoft.Framework.CopyOnWriteDictionary.Internal": { "type": "build", "version": "1.0.0-*" },
"Microsoft.Framework.NotNullAttribute.Internal": { "type": "build", "version": "1.0.0-*" },
"Microsoft.Framework.WebEncoders": "1.0.0-*"

View File

@ -71,17 +71,21 @@ namespace Microsoft.AspNet.Razor.Generator.Compiler.CSharp
RenderUnboundHTMLAttributes(unboundHTMLAttributes);
RenderRunTagHelpers();
// No need to run anything in design time mode.
if (!_designTimeMode)
{
RenderRunTagHelpers();
RenderTagOutput(_tagHelperContext.OutputGenerateStartTagMethodName);
RenderTagOutput(_tagHelperContext.OutputGeneratePreContentMethodName);
RenderTagOutput(_tagHelperContext.OutputGenerateStartTagMethodName, methodReturnsString: true);
RenderTagOutput(_tagHelperContext.OutputGeneratePreContentMethodName, methodReturnsString: false);
RenderTagHelperContent();
RenderTagHelperContent();
RenderTagOutput(_tagHelperContext.OutputGeneratePostContentMethodName);
RenderTagOutput(_tagHelperContext.OutputGenerateEndTagMethodName);
RenderTagOutput(_tagHelperContext.OutputGeneratePostContentMethodName, methodReturnsString: false);
RenderTagOutput(_tagHelperContext.OutputGenerateEndTagMethodName, methodReturnsString: true);
RenderEndTagHelpersScope();
RenderEndTagHelpersScope();
}
}
internal static string GetVariableName(TagHelperDescriptor descriptor)
@ -133,9 +137,9 @@ namespace Microsoft.AspNet.Razor.Generator.Compiler.CSharp
_context.TargetWriterName = oldWriter;
_writer.WriteParameterSeparator()
.Write(_tagHelperContext.StartWritingScopeMethodName)
.Write(_tagHelperContext.StartTagHelperWritingScopeMethodName)
.WriteParameterSeparator()
.Write(_tagHelperContext.EndWritingScopeMethodName)
.Write(_tagHelperContext.EndTagHelperWritingScopeMethodName)
.WriteEndMethodInvocation();
}
@ -358,25 +362,19 @@ namespace Microsoft.AspNet.Razor.Generator.Compiler.CSharp
private void RenderTagHelperContent()
{
// Rendering output is a runtime feature.
if (_designTimeMode)
{
return;
}
_writer.Write("if (")
.Write(ExecutionContextVariableName)
.Write(".")
.Write(_tagHelperContext.ExecutionContextOutputPropertyName)
.Write(".")
.Write(_tagHelperContext.OutputContentSetPropertyName)
.Write(_tagHelperContext.OutputIsContentModifiedPropertyName)
.WriteLine(")");
// At this point in the codegen, TagHelperOutput.Content is set. We need to use this to render the Content
// instead of executing the child content
using (_writer.BuildScope())
{
RenderTagOutput(_tagHelperContext.OutputGenerateContentMethodName);
RenderTagOutput(_tagHelperContext.OutputGenerateContentMethodName, methodReturnsString: false);
}
_writer.Write("else if (")
@ -390,7 +388,7 @@ namespace Microsoft.AspNet.Razor.Generator.Compiler.CSharp
// the cached value of the content so we don't execute the child content twice.
using (_writer.BuildScope())
{
CSharpCodeVisitor.RenderPreWriteStart(_writer, _context);
RenderStartWriteMethod();
_writer.WriteInstanceMethodInvocation(ExecutionContextVariableName,
_tagHelperContext.ExecutionContextGetChildContentAsyncMethodName,
@ -410,7 +408,7 @@ namespace Microsoft.AspNet.Razor.Generator.Compiler.CSharp
if (!string.IsNullOrEmpty(_context.TargetWriterName))
{
_writer.WriteMethodInvocation(
_tagHelperContext.StartWritingScopeMethodName,
_tagHelperContext.StartTagHelperWritingScopeMethodName,
_context.TargetWriterName);
}
@ -422,33 +420,29 @@ namespace Microsoft.AspNet.Razor.Generator.Compiler.CSharp
if (!string.IsNullOrEmpty(_context.TargetWriterName))
{
_writer.WriteMethodInvocation(_tagHelperContext.EndWritingScopeMethodName);
_writer.WriteMethodInvocation(_tagHelperContext.EndTagHelperWritingScopeMethodName);
}
}
}
private void RenderEndTagHelpersScope()
{
// Scopes/execution contexts are a runtime feature.
if (_designTimeMode)
{
return;
}
_writer.WriteStartAssignment(ExecutionContextVariableName)
.WriteInstanceMethodInvocation(ScopeManagerVariableName,
_tagHelperContext.ScopeManagerEndMethodName);
}
private void RenderTagOutput(string tagOutputMethodName)
private void RenderTagOutput(string tagOutputMethodName, bool methodReturnsString)
{
// Rendering output is a runtime feature.
if (_designTimeMode)
// If its a string WriteLiteral must be generated.
if (methodReturnsString)
{
return;
CSharpCodeVisitor.RenderPreWriteStart(_writer, _context);
}
else
{
RenderStartWriteMethod();
}
CSharpCodeVisitor.RenderPreWriteStart(_writer, _context);
_writer.Write(ExecutionContextVariableName)
.Write(".")
@ -457,15 +451,23 @@ namespace Microsoft.AspNet.Razor.Generator.Compiler.CSharp
.WriteMethodInvocation(tagOutputMethodName, endLine: false)
.WriteEndMethodInvocation();
}
private void RenderStartWriteMethod()
{
if (!string.IsNullOrEmpty(_context.TargetWriterName))
{
_writer
.WriteStartMethodInvocation(_context.Host.GeneratedClassContext.WriteToMethodName)
.Write(_context.TargetWriterName)
.WriteParameterSeparator();
}
else
{
_writer.WriteStartMethodInvocation(_context.Host.GeneratedClassContext.WriteMethodName);
}
}
private void RenderRunTagHelpers()
{
// No need to run anything in design time mode.
if (_designTimeMode)
{
return;
}
_writer.Write(ExecutionContextVariableName)
.Write(".")
.WriteStartAssignment(_tagHelperContext.ExecutionContextOutputPropertyName)
@ -541,7 +543,7 @@ namespace Microsoft.AspNet.Razor.Generator.Compiler.CSharp
// Scopes are a runtime feature.
if (!_designTimeMode)
{
_writer.WriteMethodInvocation(_tagHelperContext.StartWritingScopeMethodName);
_writer.WriteMethodInvocation(_tagHelperContext.StartTagHelperWritingScopeMethodName);
}
_bodyVisitor.Accept(chunks);
@ -550,7 +552,7 @@ namespace Microsoft.AspNet.Razor.Generator.Compiler.CSharp
if (!_designTimeMode)
{
_writer.WriteStartAssignment(StringValueBufferVariableName)
.WriteMethodInvocation(_tagHelperContext.EndWritingScopeMethodName);
.WriteMethodInvocation(_tagHelperContext.EndTagHelperWritingScopeMethodName);
}
}
finally

View File

@ -37,7 +37,7 @@ namespace Microsoft.AspNet.Razor.Generator.Compiler.CSharp
// Need to disable the warning "X is assigned to but never used." for the value buffer since
// whether it's used depends on how a TagHelper is used.
Writer.WritePragma("warning disable 0414");
WritePrivateField(typeof(TextWriter).FullName,
WritePrivateField(_tagHelperContext.TagHelperContentTypeName,
CSharpTagHelperCodeRenderer.StringValueBufferVariableName,
value: null);
Writer.WritePragma("warning restore 0414");

View File

@ -17,7 +17,7 @@ namespace Microsoft.AspNet.Razor.Generator
RunnerRunAsyncMethodName = "RunAsync";
ScopeManagerBeginMethodName = "Begin";
ScopeManagerEndMethodName = "End";
OutputContentSetPropertyName = "ContentSet";
OutputIsContentModifiedPropertyName = "IsContentModified";
OutputGenerateStartTagMethodName = "GenerateStartTag";
OutputGeneratePreContentMethodName = "GeneratePreContent";
OutputGenerateContentMethodName = "GenerateContent";
@ -30,12 +30,13 @@ namespace Microsoft.AspNet.Razor.Generator
ExecutionContextAddTagHelperAttributeMethodName = "AddTagHelperAttribute";
ExecutionContextAddHtmlAttributeMethodName = "AddHtmlAttribute";
ExecutionContextOutputPropertyName = "Output";
StartWritingScopeMethodName = "StartWritingScope";
EndWritingScopeMethodName = "EndWritingScope";
StartTagHelperWritingScopeMethodName = "StartTagHelperWritingScope";
EndTagHelperWritingScopeMethodName = "EndTagHelperWritingScope";
RunnerTypeName = "TagHelperRunner";
ScopeManagerTypeName = "TagHelperScopeManager";
ExecutionContextTypeName = "TagHelperExecutionContext";
HtmlEncoderPropertyName = "HtmlEncoder";
TagHelperContentTypeName = "TagHelperContent";
}
/// <summary>
@ -61,7 +62,7 @@ namespace Microsoft.AspNet.Razor.Generator
/// <summary>
/// The name of the property used to determine if a tag helper output's content was set.
/// </summary>
public string OutputContentSetPropertyName { get; set; }
public string OutputIsContentModifiedPropertyName { get; set; }
/// <summary>
/// The name of the method used to generate a tag helper output's start tag.
@ -127,12 +128,12 @@ namespace Microsoft.AspNet.Razor.Generator
/// <summary>
/// The name of the method used to start a new writing scope.
/// </summary>
public string StartWritingScopeMethodName { get; set; }
public string StartTagHelperWritingScopeMethodName { get; set; }
/// <summary>
/// The name of the method used to end a writing scope.
/// </summary>
public string EndWritingScopeMethodName { get; set; }
public string EndTagHelperWritingScopeMethodName { get; set; }
/// <summary>
/// The name of the type used to run tag helpers.
@ -156,5 +157,13 @@ namespace Microsoft.AspNet.Razor.Generator
/// The name of the property used to encode HTML.
/// </summary>
public string HtmlEncoderPropertyName { get; set; }
/// <summary>
/// The name of the type containing tag helper content.
/// </summary>
/// <remarks>
/// Contains the data returned by EndTagHelperWriteScope().
/// </remarks>
public string TagHelperContentTypeName { get; set; }
}
}

View File

@ -0,0 +1,435 @@
// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System;
using System.IO;
using System.Linq;
#if !ASPNETCORE50
using Moq;
#endif
using Xunit;
namespace Microsoft.AspNet.Razor.Runtime.TagHelpers
{
public class DefaultTagHelperContentTest
{
[Fact]
public void CanSetContent()
{
// Arrange
var tagHelperContent = new DefaultTagHelperContent();
var expected = "Hello World!";
// Act
tagHelperContent.SetContent(expected);
// Assert
Assert.Equal(expected, tagHelperContent.GetContent());
}
[Fact]
public void SetContentClearsExistingContent()
{
// Arrange
var tagHelperContent = new DefaultTagHelperContent();
var expected = "Hello World!";
tagHelperContent.SetContent("Contoso");
// Act
tagHelperContent.SetContent(expected);
// Assert
Assert.Equal(expected, tagHelperContent.GetContent());
}
[Theory]
[InlineData("HelloWorld!")]
[InlineData(" ")]
public void SetContent_WithTagHelperContent_WorksAsExpected(string expected)
{
// Arrange
var tagHelperContent = new DefaultTagHelperContent();
var copiedTagHelperContent = new DefaultTagHelperContent();
tagHelperContent.SetContent(expected);
// Act
copiedTagHelperContent.SetContent(tagHelperContent);
// Assert
Assert.Equal(expected, copiedTagHelperContent.GetContent());
}
// GetContent
[Fact]
public void CanGetContent()
{
// Arrange
var tagHelperContent = new DefaultTagHelperContent();
var expected = "Hello World!";
tagHelperContent.SetContent(expected);
// Act
var actual = tagHelperContent.GetContent();
// Assert
Assert.Equal(expected, actual);
}
[Fact]
public void CanAppendContent()
{
// Arrange
var tagHelperContent = new DefaultTagHelperContent();
var expected = "Hello World!";
// Act
tagHelperContent.Append(expected);
// Assert
Assert.Equal(expected, tagHelperContent.GetContent());
}
[Fact]
public void Append_WithTagHelperContent_MultipleAppends()
{
// Arrange
var tagHelperContent = new DefaultTagHelperContent();
var copiedTagHelperContent = new DefaultTagHelperContent();
var text1 = "Hello";
var text2 = " World!";
var expected = text1 + text2;
tagHelperContent.Append(text1);
tagHelperContent.Append(text2);
// Act
copiedTagHelperContent.Append(tagHelperContent);
// Assert
Assert.Equal(expected, copiedTagHelperContent.GetContent());
Assert.Equal(new[] { text1, text2 }, copiedTagHelperContent.ToArray());
}
[Fact]
public void IsModified_TrueAfterSetContent()
{
// Arrange
var tagHelperContent = new DefaultTagHelperContent();
// Act
tagHelperContent.SetContent(string.Empty);
// Assert
Assert.True(tagHelperContent.IsModified);
}
[Fact]
public void IsModified_TrueAfterAppend()
{
// Arrange
var tagHelperContent = new DefaultTagHelperContent();
// Act
tagHelperContent.Append(string.Empty);
// Assert
Assert.True(tagHelperContent.IsModified);
}
[Fact]
public void IsModified_TrueAfterClear()
{
// Arrange
var tagHelperContent = new DefaultTagHelperContent();
// Act
tagHelperContent.Clear();
// Assert
Assert.True(tagHelperContent.IsModified);
}
[Fact]
public void IsModified_TrueIfAppendedNull()
{
// Arrange
var tagHelperContent = new DefaultTagHelperContent();
TagHelperContent NullContent = null;
// Act
tagHelperContent.Append(NullContent);
// Assert
Assert.True(tagHelperContent.IsModified);
}
[Theory]
[InlineData("")]
[InlineData(" ")]
[InlineData("\n")]
[InlineData("\t")]
[InlineData("\r")]
public void CanIdentifyWhiteSpace(string data)
{
// Arrange
var tagHelperContent = new DefaultTagHelperContent();
// Act
tagHelperContent.SetContent(" ");
tagHelperContent.Append(data);
// Assert
Assert.True(tagHelperContent.IsWhiteSpace);
}
[Fact]
public void CanIdentifyWhiteSpace_WithoutIgnoringStrings()
{
// Arrange
var tagHelperContent = new DefaultTagHelperContent();
// Act
tagHelperContent.SetContent(" ");
tagHelperContent.Append("Hello");
// Assert
Assert.False(tagHelperContent.IsWhiteSpace);
}
[Fact]
public void IsEmpty_InitiallyTrue()
{
// Arrange
var tagHelperContent = new DefaultTagHelperContent();
// Act & Assert
Assert.True(tagHelperContent.IsEmpty);
}
[Fact]
public void IsEmpty_TrueAfterSetEmptyContent()
{
// Arrange
var tagHelperContent = new DefaultTagHelperContent();
// Act
tagHelperContent.SetContent(string.Empty);
// Assert
Assert.True(tagHelperContent.IsEmpty);
}
[Fact]
public void IsEmpty_TrueAfterAppendEmptyContent()
{
// Arrange
var tagHelperContent = new DefaultTagHelperContent();
// Act
tagHelperContent.Append(string.Empty);
tagHelperContent.Append(string.Empty);
// Assert
Assert.True(tagHelperContent.IsEmpty);
}
[Fact]
public void IsEmpty_TrueAfterAppendEmptyTagHelperContent()
{
// Arrange
var tagHelperContent = new DefaultTagHelperContent();
var copiedTagHelperContent = new DefaultTagHelperContent();
// Act
tagHelperContent.Append(copiedTagHelperContent);
tagHelperContent.Append(string.Empty);
// Assert
Assert.True(tagHelperContent.IsEmpty);
}
[Fact]
public void IsEmpty_TrueAfterClear()
{
// Arrange
var tagHelperContent = new DefaultTagHelperContent();
// Act
tagHelperContent.Clear();
// Assert
Assert.True(tagHelperContent.IsEmpty);
}
[Fact]
public void IsEmpty_FalseAfterSetContent()
{
// Arrange
var tagHelperContent = new DefaultTagHelperContent();
// Act
tagHelperContent.SetContent("Hello");
// Assert
Assert.False(tagHelperContent.IsEmpty);
}
[Fact]
public void IsEmpty_FalseAfterAppend()
{
// Arrange
var tagHelperContent = new DefaultTagHelperContent();
// Act
tagHelperContent.Append("Hello");
// Assert
Assert.False(tagHelperContent.IsEmpty);
}
[Fact]
public void IsEmpty_FalseAfterAppendTagHelper()
{
// Arrange
var tagHelperContent = new DefaultTagHelperContent();
var copiedTagHelperContent = new DefaultTagHelperContent();
copiedTagHelperContent.SetContent("Hello");
// Act
tagHelperContent.Append(copiedTagHelperContent);
// Assert
Assert.False(tagHelperContent.IsEmpty);
}
[Fact]
public void CanClearContent()
{
// Arrange
var tagHelperContent = new DefaultTagHelperContent();
tagHelperContent.SetContent("Hello World");
// Act
tagHelperContent.Clear();
// Assert
Assert.True(tagHelperContent.IsEmpty);
}
// CopyTo
[Fact]
public void CanWriteToTextWriter()
{
// Arrange
var writer = new StringWriter();
var tagHelperContent = new DefaultTagHelperContent();
var expected = "Hello World!";
tagHelperContent.SetContent(expected);
// Act
tagHelperContent.CopyTo(writer);
// Assert
Assert.Equal(expected, writer.ToString());
}
#if !ASPNETCORE50
[Fact]
public void CanWriteToTextWriter_MultipleAppends()
{
// Arrange
var writer = new Mock<StringWriter>();
writer.CallBase = true;
var tagHelperContent = new DefaultTagHelperContent();
var text1 = "Hello";
var text2 = " World!";
var expected = text1 + text2;
tagHelperContent.Append(text1);
tagHelperContent.Append(text2);
// Act
tagHelperContent.CopyTo(writer.Object);
// Assert
Assert.Equal(expected, writer.Object.ToString());
writer.Verify(w => w.Write(It.IsAny<string>()), Times.Exactly(2));
}
#endif
[Fact]
public void ToString_ReturnsExpectedValue()
{
// Arrange
var tagHelperContent = new DefaultTagHelperContent();
var expected = "Hello World!";
tagHelperContent.SetContent(expected);
// Act
var actual = tagHelperContent.ToString();
// Assert
Assert.Equal(expected, actual, StringComparer.Ordinal);
}
[Fact]
public void GetEnumerator_EnumeratesThroughBuffer()
{
// Arrange
var tagHelperContent = new DefaultTagHelperContent();
var expected = new string[] { "Hello", "World" };
tagHelperContent.SetContent(expected[0]);
tagHelperContent.Append(expected[1]);
var i = 0;
// Act & Assert
foreach (var val in tagHelperContent)
{
Assert.Equal(expected[i++], val);
}
}
[Fact]
public void Fluent_SetContent_Append_WritesExpectedContent()
{
// Arrange
var tagHelperContent = new DefaultTagHelperContent();
var expected = "Hello World!";
// Act
tagHelperContent.SetContent("Hello ").Append("World!");
// Assert
Assert.Equal(expected, tagHelperContent.GetContent());
}
[Fact]
public void Fluent_Clear_SetContent_WritesExpectedContent()
{
// Arrange
var tagHelperContent = new DefaultTagHelperContent();
var expected = "Hello World!";
tagHelperContent.SetContent("Some Random Content");
// Act
tagHelperContent.Clear().SetContent(expected);
// Assert
Assert.Equal(expected, tagHelperContent.GetContent());
}
[Fact]
public void Fluent_Clear_Set_Append_WritesExpectedContent()
{
// Arrange
var tagHelperContent = new DefaultTagHelperContent();
var expected = "Hello World!";
tagHelperContent.SetContent("Some Random Content");
// Act
tagHelperContent.Clear().SetContent("Hello ").Append("World!");
// Assert
Assert.Equal(expected, tagHelperContent.GetContent());
}
}
}

View File

@ -24,7 +24,7 @@ namespace Microsoft.AspNet.Razor.Runtime.TagHelpers
allAttributes: new Dictionary<string, object>(),
items: expectedItems,
uniqueId: string.Empty,
getChildContentAsync: () => Task.FromResult(string.Empty));
getChildContentAsync: () => Task.FromResult<TagHelperContent>(new DefaultTagHelperContent()));
// Assert
Assert.NotNull(context.Items);

View File

@ -3,7 +3,6 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Threading.Tasks;
using Xunit;
@ -41,8 +40,8 @@ namespace Microsoft.AspNet.Razor.Runtime.TagHelpers
items: expectedItems,
uniqueId: string.Empty,
executeChildContentAsync: async () => await Task.FromResult(result: true),
startWritingScope: () => { },
endWritingScope: () => new StringWriter());
startTagHelperWritingScope: () => { },
endTagHelperWritingScope: () => new DefaultTagHelperContent());
// Assert
Assert.NotNull(executionContext.Items);
@ -53,7 +52,7 @@ namespace Microsoft.AspNet.Razor.Runtime.TagHelpers
public async Task GetChildContentAsync_CachesValue()
{
// Arrange
var writer = new StringWriter();
var defaultTagHelperContent = new DefaultTagHelperContent();
var expectedContent = string.Empty;
var executionContext = new TagHelperExecutionContext(
"p",
@ -67,21 +66,45 @@ namespace Microsoft.AspNet.Razor.Runtime.TagHelpers
expectedContent = "Hello from child content: " + Guid.NewGuid().ToString();
}
writer.Write(expectedContent);
defaultTagHelperContent.SetContent(expectedContent);
return Task.FromResult(result: true);
},
startWritingScope: () => { },
endWritingScope: () => writer);
startTagHelperWritingScope: () => { },
endTagHelperWritingScope: () => defaultTagHelperContent);
// Act
var content1 = await executionContext.GetChildContentAsync();
var content2 = await executionContext.GetChildContentAsync();
// Assert
Assert.Same(content1, content2);
Assert.Equal(expectedContent, content1);
Assert.Equal(expectedContent, content2);
Assert.Equal(expectedContent, content1.GetContent());
Assert.Equal(expectedContent, content2.GetContent());
}
[Fact]
public async Task GetChildContentAsync_ReturnsNewObjectEveryTimeItIsCalled()
{
// Arrange
var defaultTagHelperContent = new DefaultTagHelperContent();
var executionContext = new TagHelperExecutionContext(
"p",
selfClosing: false,
items: null,
uniqueId: string.Empty,
executeChildContentAsync: () => { return Task.FromResult(result: true); },
startTagHelperWritingScope: () => { },
endTagHelperWritingScope: () => defaultTagHelperContent);
// Act
var content1 = await executionContext.GetChildContentAsync();
content1.Append("Hello");
var content2 = await executionContext.GetChildContentAsync();
content2.Append("World!");
// Assert
Assert.NotSame(content1, content2);
Assert.Empty((await executionContext.GetChildContentAsync()).GetContent());
}
[Fact]
@ -100,8 +123,8 @@ namespace Microsoft.AspNet.Razor.Runtime.TagHelpers
return Task.FromResult(result: true);
},
startWritingScope: () => { },
endWritingScope: () => new StringWriter());
startTagHelperWritingScope: () => { },
endTagHelperWritingScope: () => new DefaultTagHelperContent());
// Act
await executionContext.ExecuteChildContentAsync();

View File

@ -32,45 +32,6 @@ namespace Microsoft.AspNet.Razor.Runtime.TagHelpers
Assert.Null(tagHelperOutput.TagName);
}
[Fact]
public void Content_CanSetToNull()
{
// Arrange & Act
var tagHelperOutput = new TagHelperOutput("p")
{
Content = null
};
// Assert
Assert.Null(tagHelperOutput.Content);
}
[Fact]
public void PreContent_CanSetToNull()
{
// Arrange & Act
var tagHelperOutput = new TagHelperOutput("p")
{
PreContent = null
};
// Assert
Assert.Null(tagHelperOutput.PreContent);
}
[Fact]
public void PostContent_CanSetToNull()
{
// Arrange & Act
var tagHelperOutput = new TagHelperOutput("p")
{
PostContent = null
};
// Assert
Assert.Null(tagHelperOutput.PostContent);
}
[Fact]
public void GenerateStartTag_ReturnsFullStartTag()
{
@ -186,10 +147,8 @@ namespace Microsoft.AspNet.Razor.Runtime.TagHelpers
public void GenerateEndTag_ReturnsNothingIfWhitespaceTagName()
{
// Arrange
var tagHelperOutput = new TagHelperOutput(" ")
{
Content = "Hello World"
};
var tagHelperOutput = new TagHelperOutput(" ");
tagHelperOutput.Content.Append("Hello World");
// Act
var output = tagHelperOutput.GenerateEndTag();
@ -202,16 +161,15 @@ namespace Microsoft.AspNet.Razor.Runtime.TagHelpers
public void GeneratePreContent_ReturnsPreContent()
{
// Arrange
var tagHelperOutput = new TagHelperOutput("p")
{
PreContent = "Hello World"
};
var tagHelperOutput = new TagHelperOutput("p");
tagHelperOutput.PreContent.Append("Hello World");
// Act
var output = tagHelperOutput.GeneratePreContent();
// Assert
Assert.Equal("Hello World", output);
var result = Assert.IsType<DefaultTagHelperContent>(output);
Assert.Equal("Hello World", result.GetContent());
}
[Fact]
@ -220,15 +178,15 @@ namespace Microsoft.AspNet.Razor.Runtime.TagHelpers
// Arrange
var tagHelperOutput = new TagHelperOutput("p")
{
SelfClosing = true,
PreContent = "Hello World"
SelfClosing = true
};
tagHelperOutput.PreContent.Append("Hello World");
// Act
var output = tagHelperOutput.GeneratePreContent();
// Assert
Assert.Empty(output);
Assert.Null(output);
}
[Theory]
@ -243,31 +201,31 @@ namespace Microsoft.AspNet.Razor.Runtime.TagHelpers
var tagHelperOutput = new TagHelperOutput(tagName)
{
SelfClosing = selfClosing,
PreContent = expectedContent
SelfClosing = selfClosing
};
tagHelperOutput.PreContent.Append(expectedContent);
// Act
var output = tagHelperOutput.GeneratePreContent();
// Assert
Assert.Same(expectedContent, output);
var result = Assert.IsType<DefaultTagHelperContent>(output);
Assert.Equal(expectedContent, result.GetContent());
}
[Fact]
public void GenerateContent_ReturnsContent()
{
// Arrange
var tagHelperOutput = new TagHelperOutput("p")
{
Content = "Hello World"
};
var tagHelperOutput = new TagHelperOutput("p");
tagHelperOutput.Content.Append("Hello World");
// Act
var output = tagHelperOutput.GenerateContent();
// Assert
Assert.Equal("Hello World", output);
var result = Assert.IsType<DefaultTagHelperContent>(output);
Assert.Equal("Hello World", result.GetContent());
}
@ -277,15 +235,15 @@ namespace Microsoft.AspNet.Razor.Runtime.TagHelpers
// Arrange
var tagHelperOutput = new TagHelperOutput("p")
{
SelfClosing = true,
Content = "Hello World"
SelfClosing = true
};
tagHelperOutput.Content.Append("Hello World");
// Act
var output = tagHelperOutput.GenerateContent();
// Assert
Assert.Empty(output);
Assert.Null(output);
}
[Theory]
@ -300,31 +258,31 @@ namespace Microsoft.AspNet.Razor.Runtime.TagHelpers
var tagHelperOutput = new TagHelperOutput(tagName)
{
SelfClosing = selfClosing,
Content = expectedContent
SelfClosing = selfClosing
};
tagHelperOutput.Content.Append(expectedContent);
// Act
var output = tagHelperOutput.GenerateContent();
// Assert
Assert.Same(expectedContent, output);
var result = Assert.IsType<DefaultTagHelperContent>(output);
Assert.Equal(expectedContent, result.GetContent());
}
[Fact]
public void GeneratePostContent_ReturnsPostContent()
{
// Arrange
var tagHelperOutput = new TagHelperOutput("p")
{
PostContent = "Hello World"
};
var tagHelperOutput = new TagHelperOutput("p");
tagHelperOutput.PostContent.Append("Hello World");
// Act
var output = tagHelperOutput.GeneratePostContent();
// Assert
Assert.Equal("Hello World", output);
var result = Assert.IsType<DefaultTagHelperContent>(output);
Assert.Equal("Hello World", result.GetContent());
}
[Fact]
@ -333,15 +291,15 @@ namespace Microsoft.AspNet.Razor.Runtime.TagHelpers
// Arrange
var tagHelperOutput = new TagHelperOutput("p")
{
SelfClosing = true,
PostContent = "Hello World"
SelfClosing = true
};
tagHelperOutput.PostContent.Append("Hello World");
// Act
var output = tagHelperOutput.GeneratePostContent();
// Assert
Assert.Empty(output);
Assert.Null(output);
}
[Fact]
@ -369,15 +327,16 @@ namespace Microsoft.AspNet.Razor.Runtime.TagHelpers
var tagHelperOutput = new TagHelperOutput(tagName)
{
SelfClosing = selfClosing,
PostContent = expectedContent
SelfClosing = selfClosing
};
tagHelperOutput.PostContent.Append(expectedContent);
// Act
var output = tagHelperOutput.GeneratePostContent();
// Assert
Assert.Equal(expectedContent, output);
var result = Assert.IsType<DefaultTagHelperContent>(output);
Assert.Equal(expectedContent, result.GetContent());
}
[Fact]
@ -400,21 +359,22 @@ namespace Microsoft.AspNet.Razor.Runtime.TagHelpers
public void SuppressOutput_Sets_TagName_Content_PreContent_PostContent_ToNull()
{
// Arrange
var tagHelperOutput = new TagHelperOutput("p")
{
PreContent = "Pre Content",
Content = "Content",
PostContent = "Post Content"
};
var tagHelperOutput = new TagHelperOutput("p");
tagHelperOutput.PreContent.Append("Pre Content");
tagHelperOutput.Content.Append("Content");
tagHelperOutput.PostContent.Append("Post Content");
// Act
tagHelperOutput.SuppressOutput();
// Assert
Assert.Null(tagHelperOutput.TagName);
Assert.Null(tagHelperOutput.PreContent);
Assert.Null(tagHelperOutput.Content);
Assert.Null(tagHelperOutput.PostContent);
var result = Assert.IsType<DefaultTagHelperContent>(tagHelperOutput.PreContent);
Assert.Empty(result.GetContent());
result = Assert.IsType<DefaultTagHelperContent>(tagHelperOutput.Content);
Assert.Empty(result.GetContent());
result = Assert.IsType<DefaultTagHelperContent>(tagHelperOutput.PostContent);
Assert.Empty(result.GetContent());
}
[Fact]
@ -427,21 +387,22 @@ namespace Microsoft.AspNet.Razor.Runtime.TagHelpers
{ "class", "btn" },
{ "something", " spaced " }
},
htmlEncoder: new NullHtmlEncoder())
{
PreContent = "Pre Content",
Content = "Content",
PostContent = "Post Content"
};
htmlEncoder: new NullHtmlEncoder());
tagHelperOutput.PreContent.Append("Pre Content");
tagHelperOutput.Content.Append("Content");
tagHelperOutput.PostContent.Append("Post Content");
// Act
tagHelperOutput.SuppressOutput();
// Assert
Assert.Empty(tagHelperOutput.GenerateStartTag());
Assert.Null(tagHelperOutput.GeneratePreContent());
Assert.Null(tagHelperOutput.GenerateContent());
Assert.Null(tagHelperOutput.GeneratePostContent());
var result = Assert.IsType<DefaultTagHelperContent>(tagHelperOutput.GeneratePreContent());
Assert.Empty(result.GetContent());
result = Assert.IsType<DefaultTagHelperContent>(tagHelperOutput.GenerateContent());
Assert.Empty(result.GetContent());
result = Assert.IsType<DefaultTagHelperContent>(tagHelperOutput.GeneratePostContent());
Assert.Empty(result.GetContent());
Assert.Empty(tagHelperOutput.GenerateEndTag());
}

View File

@ -228,8 +228,8 @@ namespace Microsoft.AspNet.Razor.Runtime.Test.TagHelpers
selfClosing,
uniqueId: string.Empty,
executeChildContentAsync: async () => await Task.FromResult(result: true),
startWritingScope: () => { },
endWritingScope: () => new StringWriter());
startTagHelperWritingScope: () => { },
endTagHelperWritingScope: () => new DefaultTagHelperContent());
}
}
}

View File

@ -9,7 +9,11 @@
"test": "xunit.runner.kre"
},
"frameworks": {
"aspnet50": { },
"aspnet50": {
"dependencies": {
"Moq": "4.2.1312.1622"
}
},
"aspnetcore50": {
"dependencies": {
"System.Reflection.TypeExtensions": "4.0.0-beta-*",

View File

@ -8,7 +8,7 @@ namespace TestOutput
{
#line hidden
#pragma warning disable 0414
private System.IO.TextWriter __tagHelperStringValueBuffer = null;
private TagHelperContent __tagHelperStringValueBuffer = null;
#pragma warning restore 0414
private TagHelperExecutionContext __tagHelperExecutionContext = null;
private TagHelperRunner __tagHelperRunner = null;
@ -32,31 +32,31 @@ namespace TestOutput
WriteLiteral("\r\n ");
__tagHelperExecutionContext = __tagHelperScopeManager.Begin("p", false, "test", async() => {
}
, StartWritingScope, EndWritingScope);
, StartTagHelperWritingScope, EndTagHelperWritingScope);
__PTagHelper = CreateTagHelper<PTagHelper>();
__tagHelperExecutionContext.Add(__PTagHelper);
__tagHelperExecutionContext.Output = __tagHelperRunner.RunAsync(__tagHelperExecutionContext).Result;
WriteLiteral(__tagHelperExecutionContext.Output.GenerateStartTag());
WriteLiteral(__tagHelperExecutionContext.Output.GeneratePreContent());
if (__tagHelperExecutionContext.Output.ContentSet)
Write(__tagHelperExecutionContext.Output.GeneratePreContent());
if (__tagHelperExecutionContext.Output.IsContentModified)
{
WriteLiteral(__tagHelperExecutionContext.Output.GenerateContent());
Write(__tagHelperExecutionContext.Output.GenerateContent());
}
else if (__tagHelperExecutionContext.ChildContentRetrieved)
{
WriteLiteral(__tagHelperExecutionContext.GetChildContentAsync().Result);
Write(__tagHelperExecutionContext.GetChildContentAsync().Result);
}
else
{
__tagHelperExecutionContext.ExecuteChildContentAsync().Wait();
}
WriteLiteral(__tagHelperExecutionContext.Output.GeneratePostContent());
Write(__tagHelperExecutionContext.Output.GeneratePostContent());
WriteLiteral(__tagHelperExecutionContext.Output.GenerateEndTag());
__tagHelperExecutionContext = __tagHelperScopeManager.End();
WriteLiteral("\r\n ");
__tagHelperExecutionContext = __tagHelperScopeManager.Begin("input", true, "test", async() => {
}
, StartWritingScope, EndWritingScope);
, StartTagHelperWritingScope, EndTagHelperWritingScope);
__InputTagHelper = CreateTagHelper<InputTagHelper>();
__tagHelperExecutionContext.Add(__InputTagHelper);
__InputTagHelper.Type = **From custom attribute code renderer**: "text";
@ -66,26 +66,26 @@ namespace TestOutput
__InputTagHelper2.Type = __InputTagHelper.Type;
__tagHelperExecutionContext.Output = __tagHelperRunner.RunAsync(__tagHelperExecutionContext).Result;
WriteLiteral(__tagHelperExecutionContext.Output.GenerateStartTag());
WriteLiteral(__tagHelperExecutionContext.Output.GeneratePreContent());
if (__tagHelperExecutionContext.Output.ContentSet)
Write(__tagHelperExecutionContext.Output.GeneratePreContent());
if (__tagHelperExecutionContext.Output.IsContentModified)
{
WriteLiteral(__tagHelperExecutionContext.Output.GenerateContent());
Write(__tagHelperExecutionContext.Output.GenerateContent());
}
else if (__tagHelperExecutionContext.ChildContentRetrieved)
{
WriteLiteral(__tagHelperExecutionContext.GetChildContentAsync().Result);
Write(__tagHelperExecutionContext.GetChildContentAsync().Result);
}
else
{
__tagHelperExecutionContext.ExecuteChildContentAsync().Wait();
}
WriteLiteral(__tagHelperExecutionContext.Output.GeneratePostContent());
Write(__tagHelperExecutionContext.Output.GeneratePostContent());
WriteLiteral(__tagHelperExecutionContext.Output.GenerateEndTag());
__tagHelperExecutionContext = __tagHelperScopeManager.End();
WriteLiteral("\r\n ");
__tagHelperExecutionContext = __tagHelperScopeManager.Begin("input", true, "test", async() => {
}
, StartWritingScope, EndWritingScope);
, StartTagHelperWritingScope, EndTagHelperWritingScope);
__InputTagHelper = CreateTagHelper<InputTagHelper>();
__tagHelperExecutionContext.Add(__InputTagHelper);
__InputTagHelper.Type = **From custom attribute code renderer**: "checkbox";
@ -101,44 +101,44 @@ namespace TestOutput
__tagHelperExecutionContext.AddTagHelperAttribute("checked", __InputTagHelper2.Checked);
__tagHelperExecutionContext.Output = __tagHelperRunner.RunAsync(__tagHelperExecutionContext).Result;
WriteLiteral(__tagHelperExecutionContext.Output.GenerateStartTag());
WriteLiteral(__tagHelperExecutionContext.Output.GeneratePreContent());
if (__tagHelperExecutionContext.Output.ContentSet)
Write(__tagHelperExecutionContext.Output.GeneratePreContent());
if (__tagHelperExecutionContext.Output.IsContentModified)
{
WriteLiteral(__tagHelperExecutionContext.Output.GenerateContent());
Write(__tagHelperExecutionContext.Output.GenerateContent());
}
else if (__tagHelperExecutionContext.ChildContentRetrieved)
{
WriteLiteral(__tagHelperExecutionContext.GetChildContentAsync().Result);
Write(__tagHelperExecutionContext.GetChildContentAsync().Result);
}
else
{
__tagHelperExecutionContext.ExecuteChildContentAsync().Wait();
}
WriteLiteral(__tagHelperExecutionContext.Output.GeneratePostContent());
Write(__tagHelperExecutionContext.Output.GeneratePostContent());
WriteLiteral(__tagHelperExecutionContext.Output.GenerateEndTag());
__tagHelperExecutionContext = __tagHelperScopeManager.End();
WriteLiteral("\r\n ");
}
, StartWritingScope, EndWritingScope);
, StartTagHelperWritingScope, EndTagHelperWritingScope);
__PTagHelper = CreateTagHelper<PTagHelper>();
__tagHelperExecutionContext.Add(__PTagHelper);
__tagHelperExecutionContext.AddHtmlAttribute("class", "Hello World");
__tagHelperExecutionContext.Output = __tagHelperRunner.RunAsync(__tagHelperExecutionContext).Result;
WriteLiteral(__tagHelperExecutionContext.Output.GenerateStartTag());
WriteLiteral(__tagHelperExecutionContext.Output.GeneratePreContent());
if (__tagHelperExecutionContext.Output.ContentSet)
Write(__tagHelperExecutionContext.Output.GeneratePreContent());
if (__tagHelperExecutionContext.Output.IsContentModified)
{
WriteLiteral(__tagHelperExecutionContext.Output.GenerateContent());
Write(__tagHelperExecutionContext.Output.GenerateContent());
}
else if (__tagHelperExecutionContext.ChildContentRetrieved)
{
WriteLiteral(__tagHelperExecutionContext.GetChildContentAsync().Result);
Write(__tagHelperExecutionContext.GetChildContentAsync().Result);
}
else
{
__tagHelperExecutionContext.ExecuteChildContentAsync().Wait();
}
WriteLiteral(__tagHelperExecutionContext.Output.GeneratePostContent());
Write(__tagHelperExecutionContext.Output.GeneratePostContent());
WriteLiteral(__tagHelperExecutionContext.Output.GenerateEndTag());
__tagHelperExecutionContext = __tagHelperScopeManager.End();
Instrumentation.BeginContext(212, 8, true);

View File

@ -9,7 +9,7 @@ namespace TestOutput
{
#line hidden
#pragma warning disable 0414
private System.IO.TextWriter __tagHelperStringValueBuffer = null;
private TagHelperContent __tagHelperStringValueBuffer = null;
#pragma warning restore 0414
private TagHelperExecutionContext __tagHelperExecutionContext = null;
private TagHelperRunner __tagHelperRunner = null;
@ -33,7 +33,7 @@ namespace TestOutput
WriteLiteral("\r\n <p></p>\r\n <input type=\"text\" />\r\n ");
__tagHelperExecutionContext = __tagHelperScopeManager.Begin("input", true, "test", async() => {
}
, StartWritingScope, EndWritingScope);
, StartTagHelperWritingScope, EndTagHelperWritingScope);
__InputTagHelper = CreateTagHelper<InputTagHelper>();
__tagHelperExecutionContext.Add(__InputTagHelper);
__InputTagHelper.Type = "checkbox";
@ -49,44 +49,44 @@ namespace TestOutput
__tagHelperExecutionContext.AddTagHelperAttribute("checked", __InputTagHelper2.Checked);
__tagHelperExecutionContext.Output = __tagHelperRunner.RunAsync(__tagHelperExecutionContext).Result;
WriteLiteral(__tagHelperExecutionContext.Output.GenerateStartTag());
WriteLiteral(__tagHelperExecutionContext.Output.GeneratePreContent());
if (__tagHelperExecutionContext.Output.ContentSet)
Write(__tagHelperExecutionContext.Output.GeneratePreContent());
if (__tagHelperExecutionContext.Output.IsContentModified)
{
WriteLiteral(__tagHelperExecutionContext.Output.GenerateContent());
Write(__tagHelperExecutionContext.Output.GenerateContent());
}
else if (__tagHelperExecutionContext.ChildContentRetrieved)
{
WriteLiteral(__tagHelperExecutionContext.GetChildContentAsync().Result);
Write(__tagHelperExecutionContext.GetChildContentAsync().Result);
}
else
{
__tagHelperExecutionContext.ExecuteChildContentAsync().Wait();
}
WriteLiteral(__tagHelperExecutionContext.Output.GeneratePostContent());
Write(__tagHelperExecutionContext.Output.GeneratePostContent());
WriteLiteral(__tagHelperExecutionContext.Output.GenerateEndTag());
__tagHelperExecutionContext = __tagHelperScopeManager.End();
WriteLiteral("\r\n ");
}
, StartWritingScope, EndWritingScope);
, StartTagHelperWritingScope, EndTagHelperWritingScope);
__PTagHelper = CreateTagHelper<PTagHelper>();
__tagHelperExecutionContext.Add(__PTagHelper);
__tagHelperExecutionContext.AddHtmlAttribute("class", "Hello World");
__tagHelperExecutionContext.Output = __tagHelperRunner.RunAsync(__tagHelperExecutionContext).Result;
WriteLiteral(__tagHelperExecutionContext.Output.GenerateStartTag());
WriteLiteral(__tagHelperExecutionContext.Output.GeneratePreContent());
if (__tagHelperExecutionContext.Output.ContentSet)
Write(__tagHelperExecutionContext.Output.GeneratePreContent());
if (__tagHelperExecutionContext.Output.IsContentModified)
{
WriteLiteral(__tagHelperExecutionContext.Output.GenerateContent());
Write(__tagHelperExecutionContext.Output.GenerateContent());
}
else if (__tagHelperExecutionContext.ChildContentRetrieved)
{
WriteLiteral(__tagHelperExecutionContext.GetChildContentAsync().Result);
Write(__tagHelperExecutionContext.GetChildContentAsync().Result);
}
else
{
__tagHelperExecutionContext.ExecuteChildContentAsync().Wait();
}
WriteLiteral(__tagHelperExecutionContext.Output.GeneratePostContent());
Write(__tagHelperExecutionContext.Output.GeneratePostContent());
WriteLiteral(__tagHelperExecutionContext.Output.GenerateEndTag());
__tagHelperExecutionContext = __tagHelperScopeManager.End();
Instrumentation.BeginContext(249, 11, true);

View File

@ -9,7 +9,7 @@ namespace TestOutput
{
#line hidden
#pragma warning disable 0414
private System.IO.TextWriter __tagHelperStringValueBuffer = null;
private TagHelperContent __tagHelperStringValueBuffer = null;
#pragma warning restore 0414
private TagHelperExecutionContext __tagHelperExecutionContext = null;
private TagHelperRunner __tagHelperRunner = null;
@ -33,31 +33,31 @@ namespace TestOutput
WriteLiteral("\r\n ");
__tagHelperExecutionContext = __tagHelperScopeManager.Begin("p", false, "test", async() => {
}
, StartWritingScope, EndWritingScope);
, StartTagHelperWritingScope, EndTagHelperWritingScope);
__PTagHelper = CreateTagHelper<PTagHelper>();
__tagHelperExecutionContext.Add(__PTagHelper);
__tagHelperExecutionContext.Output = __tagHelperRunner.RunAsync(__tagHelperExecutionContext).Result;
WriteLiteral(__tagHelperExecutionContext.Output.GenerateStartTag());
WriteLiteral(__tagHelperExecutionContext.Output.GeneratePreContent());
if (__tagHelperExecutionContext.Output.ContentSet)
Write(__tagHelperExecutionContext.Output.GeneratePreContent());
if (__tagHelperExecutionContext.Output.IsContentModified)
{
WriteLiteral(__tagHelperExecutionContext.Output.GenerateContent());
Write(__tagHelperExecutionContext.Output.GenerateContent());
}
else if (__tagHelperExecutionContext.ChildContentRetrieved)
{
WriteLiteral(__tagHelperExecutionContext.GetChildContentAsync().Result);
Write(__tagHelperExecutionContext.GetChildContentAsync().Result);
}
else
{
__tagHelperExecutionContext.ExecuteChildContentAsync().Wait();
}
WriteLiteral(__tagHelperExecutionContext.Output.GeneratePostContent());
Write(__tagHelperExecutionContext.Output.GeneratePostContent());
WriteLiteral(__tagHelperExecutionContext.Output.GenerateEndTag());
__tagHelperExecutionContext = __tagHelperScopeManager.End();
WriteLiteral("\r\n ");
__tagHelperExecutionContext = __tagHelperScopeManager.Begin("input", true, "test", async() => {
}
, StartWritingScope, EndWritingScope);
, StartTagHelperWritingScope, EndTagHelperWritingScope);
__InputTagHelper = CreateTagHelper<InputTagHelper>();
__tagHelperExecutionContext.Add(__InputTagHelper);
__InputTagHelper.Type = "text";
@ -67,26 +67,26 @@ namespace TestOutput
__InputTagHelper2.Type = __InputTagHelper.Type;
__tagHelperExecutionContext.Output = __tagHelperRunner.RunAsync(__tagHelperExecutionContext).Result;
WriteLiteral(__tagHelperExecutionContext.Output.GenerateStartTag());
WriteLiteral(__tagHelperExecutionContext.Output.GeneratePreContent());
if (__tagHelperExecutionContext.Output.ContentSet)
Write(__tagHelperExecutionContext.Output.GeneratePreContent());
if (__tagHelperExecutionContext.Output.IsContentModified)
{
WriteLiteral(__tagHelperExecutionContext.Output.GenerateContent());
Write(__tagHelperExecutionContext.Output.GenerateContent());
}
else if (__tagHelperExecutionContext.ChildContentRetrieved)
{
WriteLiteral(__tagHelperExecutionContext.GetChildContentAsync().Result);
Write(__tagHelperExecutionContext.GetChildContentAsync().Result);
}
else
{
__tagHelperExecutionContext.ExecuteChildContentAsync().Wait();
}
WriteLiteral(__tagHelperExecutionContext.Output.GeneratePostContent());
Write(__tagHelperExecutionContext.Output.GeneratePostContent());
WriteLiteral(__tagHelperExecutionContext.Output.GenerateEndTag());
__tagHelperExecutionContext = __tagHelperScopeManager.End();
WriteLiteral("\r\n ");
__tagHelperExecutionContext = __tagHelperScopeManager.Begin("input", true, "test", async() => {
}
, StartWritingScope, EndWritingScope);
, StartTagHelperWritingScope, EndTagHelperWritingScope);
__InputTagHelper = CreateTagHelper<InputTagHelper>();
__tagHelperExecutionContext.Add(__InputTagHelper);
__InputTagHelper.Type = "checkbox";
@ -102,44 +102,44 @@ namespace TestOutput
__tagHelperExecutionContext.AddTagHelperAttribute("checked", __InputTagHelper2.Checked);
__tagHelperExecutionContext.Output = __tagHelperRunner.RunAsync(__tagHelperExecutionContext).Result;
WriteLiteral(__tagHelperExecutionContext.Output.GenerateStartTag());
WriteLiteral(__tagHelperExecutionContext.Output.GeneratePreContent());
if (__tagHelperExecutionContext.Output.ContentSet)
Write(__tagHelperExecutionContext.Output.GeneratePreContent());
if (__tagHelperExecutionContext.Output.IsContentModified)
{
WriteLiteral(__tagHelperExecutionContext.Output.GenerateContent());
Write(__tagHelperExecutionContext.Output.GenerateContent());
}
else if (__tagHelperExecutionContext.ChildContentRetrieved)
{
WriteLiteral(__tagHelperExecutionContext.GetChildContentAsync().Result);
Write(__tagHelperExecutionContext.GetChildContentAsync().Result);
}
else
{
__tagHelperExecutionContext.ExecuteChildContentAsync().Wait();
}
WriteLiteral(__tagHelperExecutionContext.Output.GeneratePostContent());
Write(__tagHelperExecutionContext.Output.GeneratePostContent());
WriteLiteral(__tagHelperExecutionContext.Output.GenerateEndTag());
__tagHelperExecutionContext = __tagHelperScopeManager.End();
WriteLiteral("\r\n ");
}
, StartWritingScope, EndWritingScope);
, StartTagHelperWritingScope, EndTagHelperWritingScope);
__PTagHelper = CreateTagHelper<PTagHelper>();
__tagHelperExecutionContext.Add(__PTagHelper);
__tagHelperExecutionContext.AddHtmlAttribute("class", "Hello World");
__tagHelperExecutionContext.Output = __tagHelperRunner.RunAsync(__tagHelperExecutionContext).Result;
WriteLiteral(__tagHelperExecutionContext.Output.GenerateStartTag());
WriteLiteral(__tagHelperExecutionContext.Output.GeneratePreContent());
if (__tagHelperExecutionContext.Output.ContentSet)
Write(__tagHelperExecutionContext.Output.GeneratePreContent());
if (__tagHelperExecutionContext.Output.IsContentModified)
{
WriteLiteral(__tagHelperExecutionContext.Output.GenerateContent());
Write(__tagHelperExecutionContext.Output.GenerateContent());
}
else if (__tagHelperExecutionContext.ChildContentRetrieved)
{
WriteLiteral(__tagHelperExecutionContext.GetChildContentAsync().Result);
Write(__tagHelperExecutionContext.GetChildContentAsync().Result);
}
else
{
__tagHelperExecutionContext.ExecuteChildContentAsync().Wait();
}
WriteLiteral(__tagHelperExecutionContext.Output.GeneratePostContent());
Write(__tagHelperExecutionContext.Output.GeneratePostContent());
WriteLiteral(__tagHelperExecutionContext.Output.GenerateEndTag());
__tagHelperExecutionContext = __tagHelperScopeManager.End();
Instrumentation.BeginContext(212, 8, true);

View File

@ -9,7 +9,7 @@ namespace TestOutput
{
#line hidden
#pragma warning disable 0414
private System.IO.TextWriter __tagHelperStringValueBuffer = null;
private TagHelperContent __tagHelperStringValueBuffer = null;
#pragma warning restore 0414
private TagHelperExecutionContext __tagHelperExecutionContext = null;
private TagHelperRunner __tagHelperRunner = null;
@ -61,7 +61,7 @@ namespace TestOutput
WriteLiteral("New Time: ");
__tagHelperExecutionContext = __tagHelperScopeManager.Begin("input", true, "test", async() => {
}
, StartWritingScope, EndWritingScope);
, StartTagHelperWritingScope, EndTagHelperWritingScope);
__InputTagHelper = CreateTagHelper<InputTagHelper>();
__tagHelperExecutionContext.Add(__InputTagHelper);
__InputTagHelper.Type = "text";
@ -73,42 +73,42 @@ namespace TestOutput
__tagHelperExecutionContext.AddHtmlAttribute("placeholder", "Enter in a new time...");
__tagHelperExecutionContext.Output = __tagHelperRunner.RunAsync(__tagHelperExecutionContext).Result;
WriteLiteral(__tagHelperExecutionContext.Output.GenerateStartTag());
WriteLiteral(__tagHelperExecutionContext.Output.GeneratePreContent());
if (__tagHelperExecutionContext.Output.ContentSet)
Write(__tagHelperExecutionContext.Output.GeneratePreContent());
if (__tagHelperExecutionContext.Output.IsContentModified)
{
WriteLiteral(__tagHelperExecutionContext.Output.GenerateContent());
Write(__tagHelperExecutionContext.Output.GenerateContent());
}
else if (__tagHelperExecutionContext.ChildContentRetrieved)
{
WriteLiteral(__tagHelperExecutionContext.GetChildContentAsync().Result);
Write(__tagHelperExecutionContext.GetChildContentAsync().Result);
}
else
{
__tagHelperExecutionContext.ExecuteChildContentAsync().Wait();
}
WriteLiteral(__tagHelperExecutionContext.Output.GeneratePostContent());
Write(__tagHelperExecutionContext.Output.GeneratePostContent());
WriteLiteral(__tagHelperExecutionContext.Output.GenerateEndTag());
__tagHelperExecutionContext = __tagHelperScopeManager.End();
}
, StartWritingScope, EndWritingScope);
, StartTagHelperWritingScope, EndTagHelperWritingScope);
__PTagHelper = CreateTagHelper<PTagHelper>();
__tagHelperExecutionContext.Add(__PTagHelper);
__tagHelperExecutionContext.Output = __tagHelperRunner.RunAsync(__tagHelperExecutionContext).Result;
WriteLiteral(__tagHelperExecutionContext.Output.GenerateStartTag());
WriteLiteral(__tagHelperExecutionContext.Output.GeneratePreContent());
if (__tagHelperExecutionContext.Output.ContentSet)
Write(__tagHelperExecutionContext.Output.GeneratePreContent());
if (__tagHelperExecutionContext.Output.IsContentModified)
{
WriteLiteral(__tagHelperExecutionContext.Output.GenerateContent());
Write(__tagHelperExecutionContext.Output.GenerateContent());
}
else if (__tagHelperExecutionContext.ChildContentRetrieved)
{
WriteLiteral(__tagHelperExecutionContext.GetChildContentAsync().Result);
Write(__tagHelperExecutionContext.GetChildContentAsync().Result);
}
else
{
__tagHelperExecutionContext.ExecuteChildContentAsync().Wait();
}
WriteLiteral(__tagHelperExecutionContext.Output.GeneratePostContent());
Write(__tagHelperExecutionContext.Output.GeneratePostContent());
WriteLiteral(__tagHelperExecutionContext.Output.GenerateEndTag());
__tagHelperExecutionContext = __tagHelperScopeManager.End();
WriteLiteral("\r\n");
@ -125,16 +125,16 @@ namespace TestOutput
WriteLiteral("Current Time: ");
__tagHelperExecutionContext = __tagHelperScopeManager.Begin("input", true, "test", async() => {
}
, StartWritingScope, EndWritingScope);
, StartTagHelperWritingScope, EndTagHelperWritingScope);
__InputTagHelper = CreateTagHelper<InputTagHelper>();
__tagHelperExecutionContext.Add(__InputTagHelper);
StartWritingScope();
StartTagHelperWritingScope();
#line 16 "ComplexTagHelpers.cshtml"
Write(checkbox);
#line default
#line hidden
__tagHelperStringValueBuffer = EndWritingScope();
__tagHelperStringValueBuffer = EndTagHelperWritingScope();
__InputTagHelper.Type = __tagHelperStringValueBuffer.ToString();
__tagHelperExecutionContext.AddTagHelperAttribute("type", __InputTagHelper.Type);
__InputTagHelper2 = CreateTagHelper<InputTagHelper2>();
@ -148,57 +148,57 @@ Write(checkbox);
__tagHelperExecutionContext.AddTagHelperAttribute("checked", __InputTagHelper2.Checked);
__tagHelperExecutionContext.Output = __tagHelperRunner.RunAsync(__tagHelperExecutionContext).Result;
WriteLiteral(__tagHelperExecutionContext.Output.GenerateStartTag());
WriteLiteral(__tagHelperExecutionContext.Output.GeneratePreContent());
if (__tagHelperExecutionContext.Output.ContentSet)
Write(__tagHelperExecutionContext.Output.GeneratePreContent());
if (__tagHelperExecutionContext.Output.IsContentModified)
{
WriteLiteral(__tagHelperExecutionContext.Output.GenerateContent());
Write(__tagHelperExecutionContext.Output.GenerateContent());
}
else if (__tagHelperExecutionContext.ChildContentRetrieved)
{
WriteLiteral(__tagHelperExecutionContext.GetChildContentAsync().Result);
Write(__tagHelperExecutionContext.GetChildContentAsync().Result);
}
else
{
__tagHelperExecutionContext.ExecuteChildContentAsync().Wait();
}
WriteLiteral(__tagHelperExecutionContext.Output.GeneratePostContent());
Write(__tagHelperExecutionContext.Output.GeneratePostContent());
WriteLiteral(__tagHelperExecutionContext.Output.GenerateEndTag());
__tagHelperExecutionContext = __tagHelperScopeManager.End();
}
, StartWritingScope, EndWritingScope);
, StartTagHelperWritingScope, EndTagHelperWritingScope);
__PTagHelper = CreateTagHelper<PTagHelper>();
__tagHelperExecutionContext.Add(__PTagHelper);
__tagHelperExecutionContext.Output = __tagHelperRunner.RunAsync(__tagHelperExecutionContext).Result;
WriteLiteral(__tagHelperExecutionContext.Output.GenerateStartTag());
WriteLiteral(__tagHelperExecutionContext.Output.GeneratePreContent());
if (__tagHelperExecutionContext.Output.ContentSet)
Write(__tagHelperExecutionContext.Output.GeneratePreContent());
if (__tagHelperExecutionContext.Output.IsContentModified)
{
WriteLiteral(__tagHelperExecutionContext.Output.GenerateContent());
Write(__tagHelperExecutionContext.Output.GenerateContent());
}
else if (__tagHelperExecutionContext.ChildContentRetrieved)
{
WriteLiteral(__tagHelperExecutionContext.GetChildContentAsync().Result);
Write(__tagHelperExecutionContext.GetChildContentAsync().Result);
}
else
{
__tagHelperExecutionContext.ExecuteChildContentAsync().Wait();
}
WriteLiteral(__tagHelperExecutionContext.Output.GeneratePostContent());
Write(__tagHelperExecutionContext.Output.GeneratePostContent());
WriteLiteral(__tagHelperExecutionContext.Output.GenerateEndTag());
__tagHelperExecutionContext = __tagHelperScopeManager.End();
WriteLiteral("\r\n ");
__tagHelperExecutionContext = __tagHelperScopeManager.Begin("input", true, "test", async() => {
}
, StartWritingScope, EndWritingScope);
, StartTagHelperWritingScope, EndTagHelperWritingScope);
__InputTagHelper = CreateTagHelper<InputTagHelper>();
__tagHelperExecutionContext.Add(__InputTagHelper);
StartWritingScope();
StartTagHelperWritingScope();
#line 17 "ComplexTagHelpers.cshtml"
Write(true ? "checkbox" : "anything");
#line default
#line hidden
__tagHelperStringValueBuffer = EndWritingScope();
__tagHelperStringValueBuffer = EndTagHelperWritingScope();
__InputTagHelper.Type = __tagHelperStringValueBuffer.ToString();
__tagHelperExecutionContext.AddTagHelperAttribute("type", __InputTagHelper.Type);
__InputTagHelper2 = CreateTagHelper<InputTagHelper2>();
@ -206,29 +206,29 @@ Write(true ? "checkbox" : "anything");
__InputTagHelper2.Type = __InputTagHelper.Type;
__tagHelperExecutionContext.Output = __tagHelperRunner.RunAsync(__tagHelperExecutionContext).Result;
WriteLiteral(__tagHelperExecutionContext.Output.GenerateStartTag());
WriteLiteral(__tagHelperExecutionContext.Output.GeneratePreContent());
if (__tagHelperExecutionContext.Output.ContentSet)
Write(__tagHelperExecutionContext.Output.GeneratePreContent());
if (__tagHelperExecutionContext.Output.IsContentModified)
{
WriteLiteral(__tagHelperExecutionContext.Output.GenerateContent());
Write(__tagHelperExecutionContext.Output.GenerateContent());
}
else if (__tagHelperExecutionContext.ChildContentRetrieved)
{
WriteLiteral(__tagHelperExecutionContext.GetChildContentAsync().Result);
Write(__tagHelperExecutionContext.GetChildContentAsync().Result);
}
else
{
__tagHelperExecutionContext.ExecuteChildContentAsync().Wait();
}
WriteLiteral(__tagHelperExecutionContext.Output.GeneratePostContent());
Write(__tagHelperExecutionContext.Output.GeneratePostContent());
WriteLiteral(__tagHelperExecutionContext.Output.GenerateEndTag());
__tagHelperExecutionContext = __tagHelperScopeManager.End();
WriteLiteral("\r\n ");
__tagHelperExecutionContext = __tagHelperScopeManager.Begin("input", true, "test", async() => {
}
, StartWritingScope, EndWritingScope);
, StartTagHelperWritingScope, EndTagHelperWritingScope);
__InputTagHelper = CreateTagHelper<InputTagHelper>();
__tagHelperExecutionContext.Add(__InputTagHelper);
StartWritingScope();
StartTagHelperWritingScope();
#line 18 "ComplexTagHelpers.cshtml"
if(true) {
@ -249,7 +249,7 @@ if(true) {
#line default
#line hidden
__tagHelperStringValueBuffer = EndWritingScope();
__tagHelperStringValueBuffer = EndTagHelperWritingScope();
__InputTagHelper.Type = __tagHelperStringValueBuffer.ToString();
__tagHelperExecutionContext.AddTagHelperAttribute("type", __InputTagHelper.Type);
__InputTagHelper2 = CreateTagHelper<InputTagHelper2>();
@ -257,20 +257,20 @@ if(true) {
__InputTagHelper2.Type = __InputTagHelper.Type;
__tagHelperExecutionContext.Output = __tagHelperRunner.RunAsync(__tagHelperExecutionContext).Result;
WriteLiteral(__tagHelperExecutionContext.Output.GenerateStartTag());
WriteLiteral(__tagHelperExecutionContext.Output.GeneratePreContent());
if (__tagHelperExecutionContext.Output.ContentSet)
Write(__tagHelperExecutionContext.Output.GeneratePreContent());
if (__tagHelperExecutionContext.Output.IsContentModified)
{
WriteLiteral(__tagHelperExecutionContext.Output.GenerateContent());
Write(__tagHelperExecutionContext.Output.GenerateContent());
}
else if (__tagHelperExecutionContext.ChildContentRetrieved)
{
WriteLiteral(__tagHelperExecutionContext.GetChildContentAsync().Result);
Write(__tagHelperExecutionContext.GetChildContentAsync().Result);
}
else
{
__tagHelperExecutionContext.ExecuteChildContentAsync().Wait();
}
WriteLiteral(__tagHelperExecutionContext.Output.GeneratePostContent());
Write(__tagHelperExecutionContext.Output.GeneratePostContent());
WriteLiteral(__tagHelperExecutionContext.Output.GenerateEndTag());
__tagHelperExecutionContext = __tagHelperScopeManager.End();
WriteLiteral("\r\n");
@ -282,34 +282,34 @@ if(true) {
WriteLiteral(" ");
}
, StartWritingScope, EndWritingScope);
, StartTagHelperWritingScope, EndTagHelperWritingScope);
__PTagHelper = CreateTagHelper<PTagHelper>();
__tagHelperExecutionContext.Add(__PTagHelper);
StartWritingScope();
StartTagHelperWritingScope();
WriteLiteral("Current Time: ");
#line 8 "ComplexTagHelpers.cshtml"
Write(DateTime.Now);
#line default
#line hidden
__tagHelperStringValueBuffer = EndWritingScope();
__tagHelperStringValueBuffer = EndTagHelperWritingScope();
__tagHelperExecutionContext.AddHtmlAttribute("time", __tagHelperStringValueBuffer.ToString());
__tagHelperExecutionContext.Output = __tagHelperRunner.RunAsync(__tagHelperExecutionContext).Result;
WriteLiteral(__tagHelperExecutionContext.Output.GenerateStartTag());
WriteLiteral(__tagHelperExecutionContext.Output.GeneratePreContent());
if (__tagHelperExecutionContext.Output.ContentSet)
Write(__tagHelperExecutionContext.Output.GeneratePreContent());
if (__tagHelperExecutionContext.Output.IsContentModified)
{
WriteLiteral(__tagHelperExecutionContext.Output.GenerateContent());
Write(__tagHelperExecutionContext.Output.GenerateContent());
}
else if (__tagHelperExecutionContext.ChildContentRetrieved)
{
WriteLiteral(__tagHelperExecutionContext.GetChildContentAsync().Result);
Write(__tagHelperExecutionContext.GetChildContentAsync().Result);
}
else
{
__tagHelperExecutionContext.ExecuteChildContentAsync().Wait();
}
WriteLiteral(__tagHelperExecutionContext.Output.GeneratePostContent());
Write(__tagHelperExecutionContext.Output.GeneratePostContent());
WriteLiteral(__tagHelperExecutionContext.Output.GenerateEndTag());
__tagHelperExecutionContext = __tagHelperScopeManager.End();
Instrumentation.BeginContext(672, 10, true);
@ -332,7 +332,7 @@ Write(DateTime.Now);
WriteLiteral("\r\n ");
__tagHelperExecutionContext = __tagHelperScopeManager.Begin("input", true, "test", async() => {
}
, StartWritingScope, EndWritingScope);
, StartTagHelperWritingScope, EndTagHelperWritingScope);
__InputTagHelper = CreateTagHelper<InputTagHelper>();
__tagHelperExecutionContext.Add(__InputTagHelper);
__InputTagHelper2 = CreateTagHelper<InputTagHelper2>();
@ -345,25 +345,25 @@ __InputTagHelper2.Checked = @object;
__tagHelperExecutionContext.AddTagHelperAttribute("checked", __InputTagHelper2.Checked);
__tagHelperExecutionContext.Output = __tagHelperRunner.RunAsync(__tagHelperExecutionContext).Result;
WriteLiteral(__tagHelperExecutionContext.Output.GenerateStartTag());
WriteLiteral(__tagHelperExecutionContext.Output.GeneratePreContent());
if (__tagHelperExecutionContext.Output.ContentSet)
Write(__tagHelperExecutionContext.Output.GeneratePreContent());
if (__tagHelperExecutionContext.Output.IsContentModified)
{
WriteLiteral(__tagHelperExecutionContext.Output.GenerateContent());
Write(__tagHelperExecutionContext.Output.GenerateContent());
}
else if (__tagHelperExecutionContext.ChildContentRetrieved)
{
WriteLiteral(__tagHelperExecutionContext.GetChildContentAsync().Result);
Write(__tagHelperExecutionContext.GetChildContentAsync().Result);
}
else
{
__tagHelperExecutionContext.ExecuteChildContentAsync().Wait();
}
WriteLiteral(__tagHelperExecutionContext.Output.GeneratePostContent());
Write(__tagHelperExecutionContext.Output.GeneratePostContent());
WriteLiteral(__tagHelperExecutionContext.Output.GenerateEndTag());
__tagHelperExecutionContext = __tagHelperScopeManager.End();
WriteLiteral("\r\n ");
}
, StartWritingScope, EndWritingScope);
, StartTagHelperWritingScope, EndTagHelperWritingScope);
__PTagHelper = CreateTagHelper<PTagHelper>();
__tagHelperExecutionContext.Add(__PTagHelper);
#line 21 "ComplexTagHelpers.cshtml"
@ -374,20 +374,20 @@ __PTagHelper.Age = DateTimeOffset.Now.Year - 1970;
__tagHelperExecutionContext.AddTagHelperAttribute("age", __PTagHelper.Age);
__tagHelperExecutionContext.Output = __tagHelperRunner.RunAsync(__tagHelperExecutionContext).Result;
WriteLiteral(__tagHelperExecutionContext.Output.GenerateStartTag());
WriteLiteral(__tagHelperExecutionContext.Output.GeneratePreContent());
if (__tagHelperExecutionContext.Output.ContentSet)
Write(__tagHelperExecutionContext.Output.GeneratePreContent());
if (__tagHelperExecutionContext.Output.IsContentModified)
{
WriteLiteral(__tagHelperExecutionContext.Output.GenerateContent());
Write(__tagHelperExecutionContext.Output.GenerateContent());
}
else if (__tagHelperExecutionContext.ChildContentRetrieved)
{
WriteLiteral(__tagHelperExecutionContext.GetChildContentAsync().Result);
Write(__tagHelperExecutionContext.GetChildContentAsync().Result);
}
else
{
__tagHelperExecutionContext.ExecuteChildContentAsync().Wait();
}
WriteLiteral(__tagHelperExecutionContext.Output.GeneratePostContent());
Write(__tagHelperExecutionContext.Output.GeneratePostContent());
WriteLiteral(__tagHelperExecutionContext.Output.GenerateEndTag());
__tagHelperExecutionContext = __tagHelperScopeManager.End();
Instrumentation.BeginContext(819, 10, true);
@ -397,7 +397,7 @@ __PTagHelper.Age = DateTimeOffset.Now.Year - 1970;
WriteLiteral("\r\n ");
__tagHelperExecutionContext = __tagHelperScopeManager.Begin("input", true, "test", async() => {
}
, StartWritingScope, EndWritingScope);
, StartTagHelperWritingScope, EndTagHelperWritingScope);
__InputTagHelper = CreateTagHelper<InputTagHelper>();
__tagHelperExecutionContext.Add(__InputTagHelper);
__InputTagHelper2 = CreateTagHelper<InputTagHelper2>();
@ -410,25 +410,25 @@ __InputTagHelper2.Checked = DateTimeOffset.Now.Year > 2014;
__tagHelperExecutionContext.AddTagHelperAttribute("checked", __InputTagHelper2.Checked);
__tagHelperExecutionContext.Output = __tagHelperRunner.RunAsync(__tagHelperExecutionContext).Result;
WriteLiteral(__tagHelperExecutionContext.Output.GenerateStartTag());
WriteLiteral(__tagHelperExecutionContext.Output.GeneratePreContent());
if (__tagHelperExecutionContext.Output.ContentSet)
Write(__tagHelperExecutionContext.Output.GeneratePreContent());
if (__tagHelperExecutionContext.Output.IsContentModified)
{
WriteLiteral(__tagHelperExecutionContext.Output.GenerateContent());
Write(__tagHelperExecutionContext.Output.GenerateContent());
}
else if (__tagHelperExecutionContext.ChildContentRetrieved)
{
WriteLiteral(__tagHelperExecutionContext.GetChildContentAsync().Result);
Write(__tagHelperExecutionContext.GetChildContentAsync().Result);
}
else
{
__tagHelperExecutionContext.ExecuteChildContentAsync().Wait();
}
WriteLiteral(__tagHelperExecutionContext.Output.GeneratePostContent());
Write(__tagHelperExecutionContext.Output.GeneratePostContent());
WriteLiteral(__tagHelperExecutionContext.Output.GenerateEndTag());
__tagHelperExecutionContext = __tagHelperScopeManager.End();
WriteLiteral("\r\n ");
}
, StartWritingScope, EndWritingScope);
, StartTagHelperWritingScope, EndTagHelperWritingScope);
__PTagHelper = CreateTagHelper<PTagHelper>();
__tagHelperExecutionContext.Add(__PTagHelper);
#line 25 "ComplexTagHelpers.cshtml"
@ -439,20 +439,20 @@ __PTagHelper.Age = -1970 + DateTimeOffset.Now.Year;
__tagHelperExecutionContext.AddTagHelperAttribute("age", __PTagHelper.Age);
__tagHelperExecutionContext.Output = __tagHelperRunner.RunAsync(__tagHelperExecutionContext).Result;
WriteLiteral(__tagHelperExecutionContext.Output.GenerateStartTag());
WriteLiteral(__tagHelperExecutionContext.Output.GeneratePreContent());
if (__tagHelperExecutionContext.Output.ContentSet)
Write(__tagHelperExecutionContext.Output.GeneratePreContent());
if (__tagHelperExecutionContext.Output.IsContentModified)
{
WriteLiteral(__tagHelperExecutionContext.Output.GenerateContent());
Write(__tagHelperExecutionContext.Output.GenerateContent());
}
else if (__tagHelperExecutionContext.ChildContentRetrieved)
{
WriteLiteral(__tagHelperExecutionContext.GetChildContentAsync().Result);
Write(__tagHelperExecutionContext.GetChildContentAsync().Result);
}
else
{
__tagHelperExecutionContext.ExecuteChildContentAsync().Wait();
}
WriteLiteral(__tagHelperExecutionContext.Output.GeneratePostContent());
Write(__tagHelperExecutionContext.Output.GeneratePostContent());
WriteLiteral(__tagHelperExecutionContext.Output.GenerateEndTag());
__tagHelperExecutionContext = __tagHelperScopeManager.End();
Instrumentation.BeginContext(952, 10, true);
@ -462,7 +462,7 @@ __PTagHelper.Age = -1970 + DateTimeOffset.Now.Year;
WriteLiteral("\r\n ");
__tagHelperExecutionContext = __tagHelperScopeManager.Begin("input", true, "test", async() => {
}
, StartWritingScope, EndWritingScope);
, StartTagHelperWritingScope, EndTagHelperWritingScope);
__InputTagHelper = CreateTagHelper<InputTagHelper>();
__tagHelperExecutionContext.Add(__InputTagHelper);
__InputTagHelper2 = CreateTagHelper<InputTagHelper2>();
@ -475,25 +475,25 @@ __InputTagHelper2.Checked = DateTimeOffset.Now.Year > 2014;
__tagHelperExecutionContext.AddTagHelperAttribute("checked", __InputTagHelper2.Checked);
__tagHelperExecutionContext.Output = __tagHelperRunner.RunAsync(__tagHelperExecutionContext).Result;
WriteLiteral(__tagHelperExecutionContext.Output.GenerateStartTag());
WriteLiteral(__tagHelperExecutionContext.Output.GeneratePreContent());
if (__tagHelperExecutionContext.Output.ContentSet)
Write(__tagHelperExecutionContext.Output.GeneratePreContent());
if (__tagHelperExecutionContext.Output.IsContentModified)
{
WriteLiteral(__tagHelperExecutionContext.Output.GenerateContent());
Write(__tagHelperExecutionContext.Output.GenerateContent());
}
else if (__tagHelperExecutionContext.ChildContentRetrieved)
{
WriteLiteral(__tagHelperExecutionContext.GetChildContentAsync().Result);
Write(__tagHelperExecutionContext.GetChildContentAsync().Result);
}
else
{
__tagHelperExecutionContext.ExecuteChildContentAsync().Wait();
}
WriteLiteral(__tagHelperExecutionContext.Output.GeneratePostContent());
Write(__tagHelperExecutionContext.Output.GeneratePostContent());
WriteLiteral(__tagHelperExecutionContext.Output.GenerateEndTag());
__tagHelperExecutionContext = __tagHelperScopeManager.End();
WriteLiteral("\r\n ");
}
, StartWritingScope, EndWritingScope);
, StartTagHelperWritingScope, EndTagHelperWritingScope);
__PTagHelper = CreateTagHelper<PTagHelper>();
__tagHelperExecutionContext.Add(__PTagHelper);
#line 28 "ComplexTagHelpers.cshtml"
@ -504,20 +504,20 @@ __PTagHelper.Age = DateTimeOffset.Now.Year - 1970;
__tagHelperExecutionContext.AddTagHelperAttribute("age", __PTagHelper.Age);
__tagHelperExecutionContext.Output = __tagHelperRunner.RunAsync(__tagHelperExecutionContext).Result;
WriteLiteral(__tagHelperExecutionContext.Output.GenerateStartTag());
WriteLiteral(__tagHelperExecutionContext.Output.GeneratePreContent());
if (__tagHelperExecutionContext.Output.ContentSet)
Write(__tagHelperExecutionContext.Output.GeneratePreContent());
if (__tagHelperExecutionContext.Output.IsContentModified)
{
WriteLiteral(__tagHelperExecutionContext.Output.GenerateContent());
Write(__tagHelperExecutionContext.Output.GenerateContent());
}
else if (__tagHelperExecutionContext.ChildContentRetrieved)
{
WriteLiteral(__tagHelperExecutionContext.GetChildContentAsync().Result);
Write(__tagHelperExecutionContext.GetChildContentAsync().Result);
}
else
{
__tagHelperExecutionContext.ExecuteChildContentAsync().Wait();
}
WriteLiteral(__tagHelperExecutionContext.Output.GeneratePostContent());
Write(__tagHelperExecutionContext.Output.GeneratePostContent());
WriteLiteral(__tagHelperExecutionContext.Output.GenerateEndTag());
__tagHelperExecutionContext = __tagHelperScopeManager.End();
Instrumentation.BeginContext(1080, 10, true);
@ -527,7 +527,7 @@ __PTagHelper.Age = DateTimeOffset.Now.Year - 1970;
WriteLiteral("\r\n ");
__tagHelperExecutionContext = __tagHelperScopeManager.Begin("input", true, "test", async() => {
}
, StartWritingScope, EndWritingScope);
, StartTagHelperWritingScope, EndTagHelperWritingScope);
__InputTagHelper = CreateTagHelper<InputTagHelper>();
__tagHelperExecutionContext.Add(__InputTagHelper);
__InputTagHelper2 = CreateTagHelper<InputTagHelper2>();
@ -540,25 +540,25 @@ __InputTagHelper2.Checked = DateTimeOffset.Now.Year > 2014 ;
__tagHelperExecutionContext.AddTagHelperAttribute("checked", __InputTagHelper2.Checked);
__tagHelperExecutionContext.Output = __tagHelperRunner.RunAsync(__tagHelperExecutionContext).Result;
WriteLiteral(__tagHelperExecutionContext.Output.GenerateStartTag());
WriteLiteral(__tagHelperExecutionContext.Output.GeneratePreContent());
if (__tagHelperExecutionContext.Output.ContentSet)
Write(__tagHelperExecutionContext.Output.GeneratePreContent());
if (__tagHelperExecutionContext.Output.IsContentModified)
{
WriteLiteral(__tagHelperExecutionContext.Output.GenerateContent());
Write(__tagHelperExecutionContext.Output.GenerateContent());
}
else if (__tagHelperExecutionContext.ChildContentRetrieved)
{
WriteLiteral(__tagHelperExecutionContext.GetChildContentAsync().Result);
Write(__tagHelperExecutionContext.GetChildContentAsync().Result);
}
else
{
__tagHelperExecutionContext.ExecuteChildContentAsync().Wait();
}
WriteLiteral(__tagHelperExecutionContext.Output.GeneratePostContent());
Write(__tagHelperExecutionContext.Output.GeneratePostContent());
WriteLiteral(__tagHelperExecutionContext.Output.GenerateEndTag());
__tagHelperExecutionContext = __tagHelperScopeManager.End();
WriteLiteral("\r\n ");
}
, StartWritingScope, EndWritingScope);
, StartTagHelperWritingScope, EndTagHelperWritingScope);
__PTagHelper = CreateTagHelper<PTagHelper>();
__tagHelperExecutionContext.Add(__PTagHelper);
#line 31 "ComplexTagHelpers.cshtml"
@ -569,20 +569,20 @@ __PTagHelper.Age = "My age is this long.".Length;
__tagHelperExecutionContext.AddTagHelperAttribute("age", __PTagHelper.Age);
__tagHelperExecutionContext.Output = __tagHelperRunner.RunAsync(__tagHelperExecutionContext).Result;
WriteLiteral(__tagHelperExecutionContext.Output.GenerateStartTag());
WriteLiteral(__tagHelperExecutionContext.Output.GeneratePreContent());
if (__tagHelperExecutionContext.Output.ContentSet)
Write(__tagHelperExecutionContext.Output.GeneratePreContent());
if (__tagHelperExecutionContext.Output.IsContentModified)
{
WriteLiteral(__tagHelperExecutionContext.Output.GenerateContent());
Write(__tagHelperExecutionContext.Output.GenerateContent());
}
else if (__tagHelperExecutionContext.ChildContentRetrieved)
{
WriteLiteral(__tagHelperExecutionContext.GetChildContentAsync().Result);
Write(__tagHelperExecutionContext.GetChildContentAsync().Result);
}
else
{
__tagHelperExecutionContext.ExecuteChildContentAsync().Wait();
}
WriteLiteral(__tagHelperExecutionContext.Output.GeneratePostContent());
Write(__tagHelperExecutionContext.Output.GeneratePostContent());
WriteLiteral(__tagHelperExecutionContext.Output.GenerateEndTag());
__tagHelperExecutionContext = __tagHelperScopeManager.End();
Instrumentation.BeginContext(1223, 14, true);

View File

@ -9,7 +9,7 @@ namespace TestOutput
{
#line hidden
#pragma warning disable 0414
private System.IO.TextWriter __tagHelperStringValueBuffer = null;
private TagHelperContent __tagHelperStringValueBuffer = null;
#pragma warning restore 0414
private TagHelperExecutionContext __tagHelperExecutionContext = null;
private TagHelperRunner __tagHelperRunner = null;
@ -31,7 +31,7 @@ namespace TestOutput
Instrumentation.EndContext();
__tagHelperExecutionContext = __tagHelperScopeManager.Begin("input", true, "test", async() => {
}
, StartWritingScope, EndWritingScope);
, StartTagHelperWritingScope, EndTagHelperWritingScope);
__InputTagHelper = CreateTagHelper<InputTagHelper>();
__tagHelperExecutionContext.Add(__InputTagHelper);
__InputTagHelper.Type = "";
@ -48,20 +48,20 @@ __InputTagHelper2.Checked = ;
__tagHelperExecutionContext.AddHtmlAttribute("class", "");
__tagHelperExecutionContext.Output = __tagHelperRunner.RunAsync(__tagHelperExecutionContext).Result;
WriteLiteral(__tagHelperExecutionContext.Output.GenerateStartTag());
WriteLiteral(__tagHelperExecutionContext.Output.GeneratePreContent());
if (__tagHelperExecutionContext.Output.ContentSet)
Write(__tagHelperExecutionContext.Output.GeneratePreContent());
if (__tagHelperExecutionContext.Output.IsContentModified)
{
WriteLiteral(__tagHelperExecutionContext.Output.GenerateContent());
Write(__tagHelperExecutionContext.Output.GenerateContent());
}
else if (__tagHelperExecutionContext.ChildContentRetrieved)
{
WriteLiteral(__tagHelperExecutionContext.GetChildContentAsync().Result);
Write(__tagHelperExecutionContext.GetChildContentAsync().Result);
}
else
{
__tagHelperExecutionContext.ExecuteChildContentAsync().Wait();
}
WriteLiteral(__tagHelperExecutionContext.Output.GeneratePostContent());
Write(__tagHelperExecutionContext.Output.GeneratePostContent());
WriteLiteral(__tagHelperExecutionContext.Output.GenerateEndTag());
__tagHelperExecutionContext = __tagHelperScopeManager.End();
Instrumentation.BeginContext(74, 6, true);
@ -71,7 +71,7 @@ __InputTagHelper2.Checked = ;
WriteLiteral("\r\n ");
__tagHelperExecutionContext = __tagHelperScopeManager.Begin("input", true, "test", async() => {
}
, StartWritingScope, EndWritingScope);
, StartTagHelperWritingScope, EndTagHelperWritingScope);
__InputTagHelper = CreateTagHelper<InputTagHelper>();
__tagHelperExecutionContext.Add(__InputTagHelper);
__InputTagHelper.Type = "";
@ -88,25 +88,25 @@ __InputTagHelper2.Checked = ;
__tagHelperExecutionContext.AddHtmlAttribute("class", "");
__tagHelperExecutionContext.Output = __tagHelperRunner.RunAsync(__tagHelperExecutionContext).Result;
WriteLiteral(__tagHelperExecutionContext.Output.GenerateStartTag());
WriteLiteral(__tagHelperExecutionContext.Output.GeneratePreContent());
if (__tagHelperExecutionContext.Output.ContentSet)
Write(__tagHelperExecutionContext.Output.GeneratePreContent());
if (__tagHelperExecutionContext.Output.IsContentModified)
{
WriteLiteral(__tagHelperExecutionContext.Output.GenerateContent());
Write(__tagHelperExecutionContext.Output.GenerateContent());
}
else if (__tagHelperExecutionContext.ChildContentRetrieved)
{
WriteLiteral(__tagHelperExecutionContext.GetChildContentAsync().Result);
Write(__tagHelperExecutionContext.GetChildContentAsync().Result);
}
else
{
__tagHelperExecutionContext.ExecuteChildContentAsync().Wait();
}
WriteLiteral(__tagHelperExecutionContext.Output.GeneratePostContent());
Write(__tagHelperExecutionContext.Output.GeneratePostContent());
WriteLiteral(__tagHelperExecutionContext.Output.GenerateEndTag());
__tagHelperExecutionContext = __tagHelperScopeManager.End();
WriteLiteral("\r\n ");
}
, StartWritingScope, EndWritingScope);
, StartTagHelperWritingScope, EndTagHelperWritingScope);
__PTagHelper = CreateTagHelper<PTagHelper>();
__tagHelperExecutionContext.Add(__PTagHelper);
#line 5 "EmptyAttributeTagHelpers.cshtml"
@ -117,20 +117,20 @@ __PTagHelper.Age = ;
__tagHelperExecutionContext.AddTagHelperAttribute("age", __PTagHelper.Age);
__tagHelperExecutionContext.Output = __tagHelperRunner.RunAsync(__tagHelperExecutionContext).Result;
WriteLiteral(__tagHelperExecutionContext.Output.GenerateStartTag());
WriteLiteral(__tagHelperExecutionContext.Output.GeneratePreContent());
if (__tagHelperExecutionContext.Output.ContentSet)
Write(__tagHelperExecutionContext.Output.GeneratePreContent());
if (__tagHelperExecutionContext.Output.IsContentModified)
{
WriteLiteral(__tagHelperExecutionContext.Output.GenerateContent());
Write(__tagHelperExecutionContext.Output.GenerateContent());
}
else if (__tagHelperExecutionContext.ChildContentRetrieved)
{
WriteLiteral(__tagHelperExecutionContext.GetChildContentAsync().Result);
Write(__tagHelperExecutionContext.GetChildContentAsync().Result);
}
else
{
__tagHelperExecutionContext.ExecuteChildContentAsync().Wait();
}
WriteLiteral(__tagHelperExecutionContext.Output.GeneratePostContent());
Write(__tagHelperExecutionContext.Output.GeneratePostContent());
WriteLiteral(__tagHelperExecutionContext.Output.GenerateEndTag());
__tagHelperExecutionContext = __tagHelperScopeManager.End();
Instrumentation.BeginContext(144, 8, true);

View File

@ -9,7 +9,7 @@ namespace TestOutput
{
#line hidden
#pragma warning disable 0414
private System.IO.TextWriter __tagHelperStringValueBuffer = null;
private TagHelperContent __tagHelperStringValueBuffer = null;
#pragma warning restore 0414
private TagHelperExecutionContext __tagHelperExecutionContext = null;
private TagHelperRunner __tagHelperRunner = null;
@ -40,16 +40,16 @@ namespace TestOutput
Instrumentation.EndContext();
__tagHelperExecutionContext = __tagHelperScopeManager.Begin("input", true, "test", async() => {
}
, StartWritingScope, EndWritingScope);
, StartTagHelperWritingScope, EndTagHelperWritingScope);
__InputTagHelper = CreateTagHelper<InputTagHelper>();
__tagHelperExecutionContext.Add(__InputTagHelper);
StartWritingScope();
StartTagHelperWritingScope();
#line 6 "EscapedTagHelpers.cshtml"
Write(DateTime.Now);
#line default
#line hidden
__tagHelperStringValueBuffer = EndWritingScope();
__tagHelperStringValueBuffer = EndTagHelperWritingScope();
__InputTagHelper.Type = __tagHelperStringValueBuffer.ToString();
__tagHelperExecutionContext.AddTagHelperAttribute("type", __InputTagHelper.Type);
__InputTagHelper2 = CreateTagHelper<InputTagHelper2>();
@ -63,20 +63,20 @@ Write(DateTime.Now);
__tagHelperExecutionContext.AddTagHelperAttribute("checked", __InputTagHelper2.Checked);
__tagHelperExecutionContext.Output = __tagHelperRunner.RunAsync(__tagHelperExecutionContext).Result;
WriteLiteral(__tagHelperExecutionContext.Output.GenerateStartTag());
WriteLiteral(__tagHelperExecutionContext.Output.GeneratePreContent());
if (__tagHelperExecutionContext.Output.ContentSet)
Write(__tagHelperExecutionContext.Output.GeneratePreContent());
if (__tagHelperExecutionContext.Output.IsContentModified)
{
WriteLiteral(__tagHelperExecutionContext.Output.GenerateContent());
Write(__tagHelperExecutionContext.Output.GenerateContent());
}
else if (__tagHelperExecutionContext.ChildContentRetrieved)
{
WriteLiteral(__tagHelperExecutionContext.GetChildContentAsync().Result);
Write(__tagHelperExecutionContext.GetChildContentAsync().Result);
}
else
{
__tagHelperExecutionContext.ExecuteChildContentAsync().Wait();
}
WriteLiteral(__tagHelperExecutionContext.Output.GeneratePostContent());
Write(__tagHelperExecutionContext.Output.GeneratePostContent());
WriteLiteral(__tagHelperExecutionContext.Output.GenerateEndTag());
__tagHelperExecutionContext = __tagHelperScopeManager.End();
Instrumentation.BeginContext(231, 18, true);

View File

@ -9,7 +9,7 @@ namespace TestOutput
{
#line hidden
#pragma warning disable 0414
private System.IO.TextWriter __tagHelperStringValueBuffer = null;
private TagHelperContent __tagHelperStringValueBuffer = null;
#pragma warning restore 0414
private TagHelperExecutionContext __tagHelperExecutionContext = null;
private TagHelperRunner __tagHelperRunner = null;
@ -30,7 +30,7 @@ namespace TestOutput
__tagHelperExecutionContext = __tagHelperScopeManager.Begin("p", false, "test", async() => {
WriteLiteral("Body of Tag");
}
, StartWritingScope, EndWritingScope);
, StartTagHelperWritingScope, EndTagHelperWritingScope);
__PTagHelper = CreateTagHelper<PTagHelper>();
__tagHelperExecutionContext.Add(__PTagHelper);
#line 3 "SingleTagHelper.cshtml"
@ -42,20 +42,20 @@ namespace TestOutput
__tagHelperExecutionContext.AddHtmlAttribute("class", "Hello World");
__tagHelperExecutionContext.Output = __tagHelperRunner.RunAsync(__tagHelperExecutionContext).Result;
WriteLiteral(__tagHelperExecutionContext.Output.GenerateStartTag());
WriteLiteral(__tagHelperExecutionContext.Output.GeneratePreContent());
if (__tagHelperExecutionContext.Output.ContentSet)
Write(__tagHelperExecutionContext.Output.GeneratePreContent());
if (__tagHelperExecutionContext.Output.IsContentModified)
{
WriteLiteral(__tagHelperExecutionContext.Output.GenerateContent());
Write(__tagHelperExecutionContext.Output.GenerateContent());
}
else if (__tagHelperExecutionContext.ChildContentRetrieved)
{
WriteLiteral(__tagHelperExecutionContext.GetChildContentAsync().Result);
Write(__tagHelperExecutionContext.GetChildContentAsync().Result);
}
else
{
__tagHelperExecutionContext.ExecuteChildContentAsync().Wait();
}
WriteLiteral(__tagHelperExecutionContext.Output.GeneratePostContent());
Write(__tagHelperExecutionContext.Output.GeneratePostContent());
WriteLiteral(__tagHelperExecutionContext.Output.GenerateEndTag());
__tagHelperExecutionContext = __tagHelperScopeManager.End();
}

View File

@ -34,69 +34,69 @@ MyHelper(string val)
#line default
#line hidden
}
, StartWritingScope, EndWritingScope);
, StartTagHelperWritingScope, EndTagHelperWritingScope);
__NestedTagHelper = CreateTagHelper<NestedTagHelper>();
__tagHelperExecutionContext.Add(__NestedTagHelper);
__tagHelperExecutionContext.Output = __tagHelperRunner.RunAsync(__tagHelperExecutionContext).Result;
WriteLiteral(__tagHelperExecutionContext.Output.GenerateStartTag());
WriteLiteral(__tagHelperExecutionContext.Output.GeneratePreContent());
if (__tagHelperExecutionContext.Output.ContentSet)
Write(__tagHelperExecutionContext.Output.GeneratePreContent());
if (__tagHelperExecutionContext.Output.IsContentModified)
{
WriteLiteral(__tagHelperExecutionContext.Output.GenerateContent());
Write(__tagHelperExecutionContext.Output.GenerateContent());
}
else if (__tagHelperExecutionContext.ChildContentRetrieved)
{
WriteLiteral(__tagHelperExecutionContext.GetChildContentAsync().Result);
Write(__tagHelperExecutionContext.GetChildContentAsync().Result);
}
else
{
__tagHelperExecutionContext.ExecuteChildContentAsync().Wait();
}
WriteLiteral(__tagHelperExecutionContext.Output.GeneratePostContent());
Write(__tagHelperExecutionContext.Output.GeneratePostContent());
WriteLiteral(__tagHelperExecutionContext.Output.GenerateEndTag());
__tagHelperExecutionContext = __tagHelperScopeManager.End();
WriteLiteral("\r\n ");
}
, StartWritingScope, EndWritingScope);
, StartTagHelperWritingScope, EndTagHelperWritingScope);
__MyTagHelper = CreateTagHelper<MyTagHelper>();
__tagHelperExecutionContext.Add(__MyTagHelper);
StartWritingScope();
StartTagHelperWritingScope();
WriteLiteral("Current Time: ");
#line 6 "TagHelpersInHelper.cshtml"
Write(DateTime.Now);
#line default
#line hidden
__tagHelperStringValueBuffer = EndWritingScope();
__tagHelperStringValueBuffer = EndTagHelperWritingScope();
__MyTagHelper.BoundProperty = __tagHelperStringValueBuffer.ToString();
__tagHelperExecutionContext.AddTagHelperAttribute("BoundProperty", __MyTagHelper.BoundProperty);
StartWritingScope();
StartTagHelperWritingScope();
WriteLiteral("Current Time: ");
#line 6 "TagHelpersInHelper.cshtml"
Write(DateTime.Now);
#line default
#line hidden
__tagHelperStringValueBuffer = EndWritingScope();
__tagHelperStringValueBuffer = EndTagHelperWritingScope();
__tagHelperExecutionContext.AddHtmlAttribute("unboundproperty", __tagHelperStringValueBuffer.ToString());
__tagHelperExecutionContext.Output = __tagHelperRunner.RunAsync(__tagHelperExecutionContext).Result;
WriteLiteralTo(__razor_helper_writer, __tagHelperExecutionContext.Output.GenerateStartTag());
WriteLiteralTo(__razor_helper_writer, __tagHelperExecutionContext.Output.GeneratePreContent());
if (__tagHelperExecutionContext.Output.ContentSet)
WriteTo(__razor_helper_writer, __tagHelperExecutionContext.Output.GeneratePreContent());
if (__tagHelperExecutionContext.Output.IsContentModified)
{
WriteLiteralTo(__razor_helper_writer, __tagHelperExecutionContext.Output.GenerateContent());
WriteTo(__razor_helper_writer, __tagHelperExecutionContext.Output.GenerateContent());
}
else if (__tagHelperExecutionContext.ChildContentRetrieved)
{
WriteLiteralTo(__razor_helper_writer, __tagHelperExecutionContext.GetChildContentAsync().Result);
WriteTo(__razor_helper_writer, __tagHelperExecutionContext.GetChildContentAsync().Result);
}
else
{
StartWritingScope(__razor_helper_writer);
StartTagHelperWritingScope(__razor_helper_writer);
__tagHelperExecutionContext.ExecuteChildContentAsync().Wait();
EndWritingScope();
EndTagHelperWritingScope();
}
WriteLiteralTo(__razor_helper_writer, __tagHelperExecutionContext.Output.GeneratePostContent());
WriteTo(__razor_helper_writer, __tagHelperExecutionContext.Output.GeneratePostContent());
WriteLiteralTo(__razor_helper_writer, __tagHelperExecutionContext.Output.GenerateEndTag());
__tagHelperExecutionContext = __tagHelperScopeManager.End();
Instrumentation.BeginContext(342, 14, true);
@ -117,7 +117,7 @@ Write(DateTime.Now);
#line hidden
#pragma warning disable 0414
private System.IO.TextWriter __tagHelperStringValueBuffer = null;
private TagHelperContent __tagHelperStringValueBuffer = null;
#pragma warning restore 0414
private TagHelperExecutionContext __tagHelperExecutionContext = null;
private TagHelperRunner __tagHelperRunner = null;
@ -142,27 +142,27 @@ Write(MyHelper(item => new Template((__razor_template_writer) => {
__tagHelperExecutionContext = __tagHelperScopeManager.Begin("nestedtaghelper", false, "test", async() => {
WriteLiteral("Custom Value");
}
, StartWritingScope, EndWritingScope);
, StartTagHelperWritingScope, EndTagHelperWritingScope);
__NestedTagHelper = CreateTagHelper<NestedTagHelper>();
__tagHelperExecutionContext.Add(__NestedTagHelper);
__tagHelperExecutionContext.Output = __tagHelperRunner.RunAsync(__tagHelperExecutionContext).Result;
WriteLiteralTo(__razor_template_writer, __tagHelperExecutionContext.Output.GenerateStartTag());
WriteLiteralTo(__razor_template_writer, __tagHelperExecutionContext.Output.GeneratePreContent());
if (__tagHelperExecutionContext.Output.ContentSet)
WriteTo(__razor_template_writer, __tagHelperExecutionContext.Output.GeneratePreContent());
if (__tagHelperExecutionContext.Output.IsContentModified)
{
WriteLiteralTo(__razor_template_writer, __tagHelperExecutionContext.Output.GenerateContent());
WriteTo(__razor_template_writer, __tagHelperExecutionContext.Output.GenerateContent());
}
else if (__tagHelperExecutionContext.ChildContentRetrieved)
{
WriteLiteralTo(__razor_template_writer, __tagHelperExecutionContext.GetChildContentAsync().Result);
WriteTo(__razor_template_writer, __tagHelperExecutionContext.GetChildContentAsync().Result);
}
else
{
StartWritingScope(__razor_template_writer);
StartTagHelperWritingScope(__razor_template_writer);
__tagHelperExecutionContext.ExecuteChildContentAsync().Wait();
EndWritingScope();
EndTagHelperWritingScope();
}
WriteLiteralTo(__razor_template_writer, __tagHelperExecutionContext.Output.GeneratePostContent());
WriteTo(__razor_template_writer, __tagHelperExecutionContext.Output.GeneratePostContent());
WriteLiteralTo(__razor_template_writer, __tagHelperExecutionContext.Output.GenerateEndTag());
__tagHelperExecutionContext = __tagHelperScopeManager.End();
}
@ -172,25 +172,25 @@ Write(MyHelper(item => new Template((__razor_template_writer) => {
#line default
#line hidden
}
, StartWritingScope, EndWritingScope);
, StartTagHelperWritingScope, EndTagHelperWritingScope);
__MyTagHelper = CreateTagHelper<MyTagHelper>();
__tagHelperExecutionContext.Add(__MyTagHelper);
__tagHelperExecutionContext.Output = __tagHelperRunner.RunAsync(__tagHelperExecutionContext).Result;
WriteLiteral(__tagHelperExecutionContext.Output.GenerateStartTag());
WriteLiteral(__tagHelperExecutionContext.Output.GeneratePreContent());
if (__tagHelperExecutionContext.Output.ContentSet)
Write(__tagHelperExecutionContext.Output.GeneratePreContent());
if (__tagHelperExecutionContext.Output.IsContentModified)
{
WriteLiteral(__tagHelperExecutionContext.Output.GenerateContent());
Write(__tagHelperExecutionContext.Output.GenerateContent());
}
else if (__tagHelperExecutionContext.ChildContentRetrieved)
{
WriteLiteral(__tagHelperExecutionContext.GetChildContentAsync().Result);
Write(__tagHelperExecutionContext.GetChildContentAsync().Result);
}
else
{
__tagHelperExecutionContext.ExecuteChildContentAsync().Wait();
}
WriteLiteral(__tagHelperExecutionContext.Output.GeneratePostContent());
Write(__tagHelperExecutionContext.Output.GeneratePostContent());
WriteLiteral(__tagHelperExecutionContext.Output.GenerateEndTag());
__tagHelperExecutionContext = __tagHelperScopeManager.End();
Instrumentation.BeginContext(445, 2, true);

View File

@ -8,7 +8,7 @@ namespace TestOutput
{
#line hidden
#pragma warning disable 0414
private System.IO.TextWriter __tagHelperStringValueBuffer = null;
private TagHelperContent __tagHelperStringValueBuffer = null;
#pragma warning restore 0414
private TagHelperExecutionContext __tagHelperExecutionContext = null;
private TagHelperRunner __tagHelperRunner = null;
@ -50,69 +50,69 @@ namespace TestOutput
#line default
#line hidden
}
, StartWritingScope, EndWritingScope);
, StartTagHelperWritingScope, EndTagHelperWritingScope);
__NestedTagHelper = CreateTagHelper<NestedTagHelper>();
__tagHelperExecutionContext.Add(__NestedTagHelper);
__tagHelperExecutionContext.Output = __tagHelperRunner.RunAsync(__tagHelperExecutionContext).Result;
WriteLiteral(__tagHelperExecutionContext.Output.GenerateStartTag());
WriteLiteral(__tagHelperExecutionContext.Output.GeneratePreContent());
if (__tagHelperExecutionContext.Output.ContentSet)
Write(__tagHelperExecutionContext.Output.GeneratePreContent());
if (__tagHelperExecutionContext.Output.IsContentModified)
{
WriteLiteral(__tagHelperExecutionContext.Output.GenerateContent());
Write(__tagHelperExecutionContext.Output.GenerateContent());
}
else if (__tagHelperExecutionContext.ChildContentRetrieved)
{
WriteLiteral(__tagHelperExecutionContext.GetChildContentAsync().Result);
Write(__tagHelperExecutionContext.GetChildContentAsync().Result);
}
else
{
__tagHelperExecutionContext.ExecuteChildContentAsync().Wait();
}
WriteLiteral(__tagHelperExecutionContext.Output.GeneratePostContent());
Write(__tagHelperExecutionContext.Output.GeneratePostContent());
WriteLiteral(__tagHelperExecutionContext.Output.GenerateEndTag());
__tagHelperExecutionContext = __tagHelperScopeManager.End();
WriteLiteral("\r\n ");
}
, StartWritingScope, EndWritingScope);
, StartTagHelperWritingScope, EndTagHelperWritingScope);
__MyTagHelper = CreateTagHelper<MyTagHelper>();
__tagHelperExecutionContext.Add(__MyTagHelper);
StartWritingScope();
StartTagHelperWritingScope();
WriteLiteral("Current Time: ");
#line 9 "TagHelpersInSection.cshtml"
Write(DateTime.Now);
#line default
#line hidden
__tagHelperStringValueBuffer = EndWritingScope();
__tagHelperStringValueBuffer = EndTagHelperWritingScope();
__MyTagHelper.BoundProperty = __tagHelperStringValueBuffer.ToString();
__tagHelperExecutionContext.AddTagHelperAttribute("BoundProperty", __MyTagHelper.BoundProperty);
StartWritingScope();
StartTagHelperWritingScope();
WriteLiteral("Current Time: ");
#line 9 "TagHelpersInSection.cshtml"
Write(DateTime.Now);
#line default
#line hidden
__tagHelperStringValueBuffer = EndWritingScope();
__tagHelperStringValueBuffer = EndTagHelperWritingScope();
__tagHelperExecutionContext.AddHtmlAttribute("unboundproperty", __tagHelperStringValueBuffer.ToString());
__tagHelperExecutionContext.Output = __tagHelperRunner.RunAsync(__tagHelperExecutionContext).Result;
WriteLiteralTo(__razor_template_writer, __tagHelperExecutionContext.Output.GenerateStartTag());
WriteLiteralTo(__razor_template_writer, __tagHelperExecutionContext.Output.GeneratePreContent());
if (__tagHelperExecutionContext.Output.ContentSet)
WriteTo(__razor_template_writer, __tagHelperExecutionContext.Output.GeneratePreContent());
if (__tagHelperExecutionContext.Output.IsContentModified)
{
WriteLiteralTo(__razor_template_writer, __tagHelperExecutionContext.Output.GenerateContent());
WriteTo(__razor_template_writer, __tagHelperExecutionContext.Output.GenerateContent());
}
else if (__tagHelperExecutionContext.ChildContentRetrieved)
{
WriteLiteralTo(__razor_template_writer, __tagHelperExecutionContext.GetChildContentAsync().Result);
WriteTo(__razor_template_writer, __tagHelperExecutionContext.GetChildContentAsync().Result);
}
else
{
StartWritingScope(__razor_template_writer);
StartTagHelperWritingScope(__razor_template_writer);
__tagHelperExecutionContext.ExecuteChildContentAsync().Wait();
EndWritingScope();
EndTagHelperWritingScope();
}
WriteLiteralTo(__razor_template_writer, __tagHelperExecutionContext.Output.GeneratePostContent());
WriteTo(__razor_template_writer, __tagHelperExecutionContext.Output.GeneratePostContent());
WriteLiteralTo(__razor_template_writer, __tagHelperExecutionContext.Output.GenerateEndTag());
__tagHelperExecutionContext = __tagHelperScopeManager.End();
Instrumentation.BeginContext(359, 14, true);