This commit is contained in:
N. Taylor Mullen 2015-07-31 15:47:29 -07:00
parent e0abf70a80
commit c8df81ef91
18 changed files with 48 additions and 48 deletions

View File

@ -353,7 +353,7 @@ namespace Microsoft.AspNet.Mvc.Razor
}
else if (tagHelperExecutionContext.ChildContentRetrieved)
{
var childContent = await tagHelperExecutionContext.GetChildContentAsync();
var childContent = await tagHelperExecutionContext.GetChildContentAsync(useCachedResult: true);
WriteTo(writer, childContent);
}
else
@ -387,7 +387,7 @@ namespace Microsoft.AspNet.Mvc.Razor
/// <param name="writer">The <see cref="TextWriter"/> instance to write to.</param>
/// <param name="value">The <see cref="object"/> to write.</param>
/// <remarks>
/// <paramref name="value"/>s of type <see cref="IHtmlContent"/> are written using
/// <paramref name="value"/>s of type <see cref="IHtmlContent"/> are written using
/// <see cref="IHtmlContent.WriteTo(TextWriter, IHtmlEncoder)"/>.
/// For all other types, the encoded result of <see cref="object.ToString"/> is written to the
/// <paramref name="writer"/>.
@ -408,7 +408,7 @@ namespace Microsoft.AspNet.Mvc.Razor
/// Otherwise writes <see cref="HtmlString"/> values as-is.
/// </param>
/// <remarks>
/// <paramref name="value"/>s of type <see cref="IHtmlContent"/> are written using
/// <paramref name="value"/>s of type <see cref="IHtmlContent"/> are written using
/// <see cref="IHtmlContent.WriteTo(TextWriter, IHtmlEncoder)"/>.
/// For all other types, the encoded result of <see cref="object.ToString"/> is written to the
/// <paramref name="writer"/>.

View File

@ -1367,7 +1367,7 @@ namespace Microsoft.AspNet.Mvc.Razor
tagHelperExecutionContext.Output = new TagHelperOutput("p", new TagHelperAttributeList());
if (childContentRetrieved)
{
await tagHelperExecutionContext.GetChildContentAsync();
await tagHelperExecutionContext.GetChildContentAsync(useCachedResult: true);
}
// Act

View File

@ -36,7 +36,7 @@ namespace Microsoft.AspNet.Mvc.TagHelpers
},
items: new Dictionary<object, object>(),
uniqueId: "test",
getChildContentAsync: () =>
getChildContentAsync: useCachedResult =>
{
var tagHelperContent = new DefaultTagHelperContent();
tagHelperContent.SetContent("Something Else");
@ -93,7 +93,7 @@ namespace Microsoft.AspNet.Mvc.TagHelpers
Enumerable.Empty<IReadOnlyTagHelperAttribute>()),
items: new Dictionary<object, object>(),
uniqueId: "test",
getChildContentAsync: () =>
getChildContentAsync: useCachedResult =>
{
var tagHelperContent = new DefaultTagHelperContent();
tagHelperContent.SetContent("Something");
@ -141,7 +141,7 @@ namespace Microsoft.AspNet.Mvc.TagHelpers
Enumerable.Empty<IReadOnlyTagHelperAttribute>()),
items: new Dictionary<object, object>(),
uniqueId: "test",
getChildContentAsync: () =>
getChildContentAsync: useCachedResult =>
{
var tagHelperContent = new DefaultTagHelperContent();
tagHelperContent.SetContent("Something");

View File

@ -724,7 +724,7 @@ namespace Microsoft.AspNet.Mvc.TagHelpers
allAttributes: new TagHelperAttributeList(),
items: new Dictionary<object, object>(),
uniqueId: id,
getChildContentAsync: () =>
getChildContentAsync: useCachedResult =>
{
TagHelperContent tagHelperContent;
if(!cache.TryGetValue("key1", out tagHelperContent))
@ -781,7 +781,7 @@ namespace Microsoft.AspNet.Mvc.TagHelpers
allAttributes: new TagHelperAttributeList(),
items: new Dictionary<object, object>(),
uniqueId: id,
getChildContentAsync: () =>
getChildContentAsync: useCachedResult =>
{
var tagHelperContent = new DefaultTagHelperContent();
tagHelperContent.SetContent(childContent);

View File

@ -136,7 +136,7 @@ namespace Microsoft.AspNet.Mvc.TagHelpers.Test
attributes,
items: new Dictionary<object, object>(),
uniqueId: Guid.NewGuid().ToString("N"),
getChildContentAsync: () =>
getChildContentAsync: useCachedResult =>
{
var tagHelperContent = new DefaultTagHelperContent();
tagHelperContent.SetContent(content);

View File

@ -37,7 +37,7 @@ namespace Microsoft.AspNet.Mvc.TagHelpers
},
items: new Dictionary<object, object>(),
uniqueId: "test",
getChildContentAsync: () =>
getChildContentAsync: useCachedResult =>
{
var tagHelperContent = new DefaultTagHelperContent();
tagHelperContent.SetContent("Something Else");
@ -103,7 +103,7 @@ namespace Microsoft.AspNet.Mvc.TagHelpers
Enumerable.Empty<IReadOnlyTagHelperAttribute>()),
items: new Dictionary<object, object>(),
uniqueId: "test",
getChildContentAsync: () =>
getChildContentAsync: useCachedResult =>
{
var tagHelperContent = new DefaultTagHelperContent();
tagHelperContent.SetContent("Something");
@ -154,7 +154,7 @@ namespace Microsoft.AspNet.Mvc.TagHelpers
Enumerable.Empty<IReadOnlyTagHelperAttribute>()),
items: new Dictionary<object, object>(),
uniqueId: "test",
getChildContentAsync: () =>
getChildContentAsync: useCachedResult =>
{
var tagHelperContent = new DefaultTagHelperContent();
tagHelperContent.SetContent("Something");
@ -226,7 +226,7 @@ namespace Microsoft.AspNet.Mvc.TagHelpers
Enumerable.Empty<IReadOnlyTagHelperAttribute>()),
items: new Dictionary<object, object>(),
uniqueId: "test",
getChildContentAsync: () =>
getChildContentAsync: useCachedResult =>
{
var tagHelperContent = new DefaultTagHelperContent();
tagHelperContent.SetContent("Something");
@ -277,7 +277,7 @@ namespace Microsoft.AspNet.Mvc.TagHelpers
Enumerable.Empty<IReadOnlyTagHelperAttribute>()),
items: new Dictionary<object, object>(),
uniqueId: "test",
getChildContentAsync: () =>
getChildContentAsync: useCachedResult =>
{
var tagHelperContent = new DefaultTagHelperContent();
tagHelperContent.SetContent("Something");
@ -351,7 +351,7 @@ namespace Microsoft.AspNet.Mvc.TagHelpers
Enumerable.Empty<IReadOnlyTagHelperAttribute>()),
items: new Dictionary<object, object>(),
uniqueId: "test",
getChildContentAsync: () =>
getChildContentAsync: useCachedResult =>
{
var tagHelperContent = new DefaultTagHelperContent();
tagHelperContent.SetContent("Something");

View File

@ -220,7 +220,7 @@ namespace Microsoft.AspNet.Mvc.TagHelpers
attributes,
items: new Dictionary<object, object>(),
uniqueId: Guid.NewGuid().ToString("N"),
getChildContentAsync: () =>
getChildContentAsync: useCachedResult =>
{
var tagHelperContent = new DefaultTagHelperContent();
tagHelperContent.SetContent(default(string));

View File

@ -90,7 +90,7 @@ namespace Microsoft.AspNet.Mvc.TagHelpers
Enumerable.Empty<IReadOnlyTagHelperAttribute>()),
items: new Dictionary<object, object>(),
uniqueId: "test",
getChildContentAsync: () => Task.FromResult<TagHelperContent>(result: null));
getChildContentAsync: useCachedResult => Task.FromResult<TagHelperContent>(result: null));
var output = new TagHelperOutput(originalTagName, outputAttributes)
{
SelfClosing = true,
@ -194,7 +194,7 @@ namespace Microsoft.AspNet.Mvc.TagHelpers
Enumerable.Empty<IReadOnlyTagHelperAttribute>()),
items: new Dictionary<object, object>(),
uniqueId: "test",
getChildContentAsync: () =>
getChildContentAsync: useCachedResult =>
{
var tagHelperContent = new DefaultTagHelperContent();
tagHelperContent.SetContent("Something");
@ -256,7 +256,7 @@ namespace Microsoft.AspNet.Mvc.TagHelpers
Enumerable.Empty<IReadOnlyTagHelperAttribute>()),
items: new Dictionary<object, object>(),
uniqueId: "test",
getChildContentAsync: () =>
getChildContentAsync: useCachedResult =>
{
var tagHelperContent = new DefaultTagHelperContent();
tagHelperContent.SetContent("Something");
@ -352,7 +352,7 @@ namespace Microsoft.AspNet.Mvc.TagHelpers
allAttributes: contextAttributes,
items: new Dictionary<object, object>(),
uniqueId: "test",
getChildContentAsync: () =>
getChildContentAsync: useCachedResult =>
{
var tagHelperContent = new DefaultTagHelperContent();
tagHelperContent.SetContent("Something");
@ -451,7 +451,7 @@ namespace Microsoft.AspNet.Mvc.TagHelpers
allAttributes: contextAttributes,
items: new Dictionary<object, object>(),
uniqueId: "test",
getChildContentAsync: () =>
getChildContentAsync: useCachedResult =>
{
var tagHelperContent = new DefaultTagHelperContent();
tagHelperContent.SetContent("Something");
@ -547,7 +547,7 @@ namespace Microsoft.AspNet.Mvc.TagHelpers
allAttributes: contextAttributes,
items: new Dictionary<object, object>(),
uniqueId: "test",
getChildContentAsync: () =>
getChildContentAsync: useCachedResult =>
{
var tagHelperContent = new DefaultTagHelperContent();
tagHelperContent.SetContent("Something");
@ -654,7 +654,7 @@ namespace Microsoft.AspNet.Mvc.TagHelpers
allAttributes: contextAttributes,
items: new Dictionary<object, object>(),
uniqueId: "test",
getChildContentAsync: () =>
getChildContentAsync: useCachedResult =>
{
var tagHelperContent = new DefaultTagHelperContent();
tagHelperContent.SetContent("Something");
@ -774,7 +774,7 @@ namespace Microsoft.AspNet.Mvc.TagHelpers
Enumerable.Empty<IReadOnlyTagHelperAttribute>()),
items: new Dictionary<object, object>(),
uniqueId: "test",
getChildContentAsync: () => Task.FromResult<TagHelperContent>(new DefaultTagHelperContent()));
getChildContentAsync: useCachedResult => Task.FromResult<TagHelperContent>(new DefaultTagHelperContent()));
var output = new TagHelperOutput(expectedTagName, attributes: new TagHelperAttributeList())
{
@ -855,7 +855,7 @@ namespace Microsoft.AspNet.Mvc.TagHelpers
Enumerable.Empty<IReadOnlyTagHelperAttribute>()),
items: new Dictionary<object, object>(),
uniqueId: "test",
getChildContentAsync: () => Task.FromResult<TagHelperContent>(new DefaultTagHelperContent()));
getChildContentAsync: useCachedResult => Task.FromResult<TagHelperContent>(new DefaultTagHelperContent()));
var output = new TagHelperOutput(expectedTagName, attributes: new TagHelperAttributeList())
{

View File

@ -129,7 +129,7 @@ namespace Microsoft.AspNet.Mvc.TagHelpers.Internal
attributes,
items: new Dictionary<object, object>(),
uniqueId: Guid.NewGuid().ToString("N"),
getChildContentAsync: () =>
getChildContentAsync: useCachedResult =>
{
var tagHelperContent = new DefaultTagHelperContent();
tagHelperContent.Append(content);

View File

@ -192,7 +192,7 @@ namespace Microsoft.AspNet.Mvc.TagHelpers
Enumerable.Empty<IReadOnlyTagHelperAttribute>()),
items: new Dictionary<object, object>(),
uniqueId: "test",
getChildContentAsync: () =>
getChildContentAsync: useCachedResult =>
{
var tagHelperContent = new DefaultTagHelperContent();
tagHelperContent.SetContent(tagHelperOutputContent.OriginalChildContent);

View File

@ -775,7 +775,7 @@ namespace Microsoft.AspNet.Mvc.TagHelpers
attributes,
items: new Dictionary<object, object>(),
uniqueId: Guid.NewGuid().ToString("N"),
getChildContentAsync: () =>
getChildContentAsync: useCachedResult =>
{
var tagHelperContent = new DefaultTagHelperContent();
tagHelperContent.SetContent(content);

View File

@ -398,7 +398,7 @@ namespace Microsoft.AspNet.Mvc.TagHelpers
contextAttributes,
items: new Dictionary<object, object>(),
uniqueId: "test",
getChildContentAsync: () =>
getChildContentAsync: useCachedResult =>
{
// GetChildContentAsync should not be invoked since we are setting the content below.
Assert.True(false);
@ -467,7 +467,7 @@ namespace Microsoft.AspNet.Mvc.TagHelpers
contextAttributes,
items: new Dictionary<object, object>(),
uniqueId: "test",
getChildContentAsync: () =>
getChildContentAsync: useCachedResult =>
{
var tagHelperContent = new DefaultTagHelperContent();
tagHelperContent.SetContent(originalContent);
@ -528,7 +528,7 @@ namespace Microsoft.AspNet.Mvc.TagHelpers
contextAttributes,
items: new Dictionary<object, object>(),
uniqueId: "test",
getChildContentAsync: () =>
getChildContentAsync: useCachedResult =>
{
var tagHelperContent = new DefaultTagHelperContent();
tagHelperContent.SetContent(originalContent);

View File

@ -842,7 +842,7 @@ namespace Microsoft.AspNet.Mvc.TagHelpers
attributes,
items: new Dictionary<object, object>(),
uniqueId: Guid.NewGuid().ToString("N"),
getChildContentAsync: () =>
getChildContentAsync: useCachedResult =>
{
var tagHelperContent = new DefaultTagHelperContent();
tagHelperContent.SetContent(content);

View File

@ -202,7 +202,7 @@ namespace Microsoft.AspNet.Mvc.TagHelpers
Enumerable.Empty<IReadOnlyTagHelperAttribute>()),
items: new Dictionary<object, object>(),
uniqueId: "test",
getChildContentAsync: () =>
getChildContentAsync: useCachedResult =>
{
var tagHelperContent = new DefaultTagHelperContent();
tagHelperContent.SetContent("Something");
@ -289,7 +289,7 @@ namespace Microsoft.AspNet.Mvc.TagHelpers
Enumerable.Empty<IReadOnlyTagHelperAttribute>()),
items: new Dictionary<object, object>(),
uniqueId: "test",
getChildContentAsync: () =>
getChildContentAsync: useCachedResult =>
{
var tagHelperContent = new DefaultTagHelperContent();
tagHelperContent.SetContent("Something");
@ -391,7 +391,7 @@ namespace Microsoft.AspNet.Mvc.TagHelpers
Enumerable.Empty<IReadOnlyTagHelperAttribute>()),
items: new Dictionary<object, object>(),
uniqueId: "test",
getChildContentAsync: () =>
getChildContentAsync: useCachedResult =>
{
var tagHelperContent = new DefaultTagHelperContent();
tagHelperContent.SetContent("Something");
@ -477,7 +477,7 @@ namespace Microsoft.AspNet.Mvc.TagHelpers
contextAttributes,
items: new Dictionary<object, object>(),
uniqueId: "test",
getChildContentAsync: () =>
getChildContentAsync: useCachedResult =>
{
var tagHelperContent = new DefaultTagHelperContent();
tagHelperContent.SetContent("Something");
@ -556,7 +556,7 @@ namespace Microsoft.AspNet.Mvc.TagHelpers
contextAttributes,
items: new Dictionary<object, object>(),
uniqueId: "test",
getChildContentAsync: () =>
getChildContentAsync: useCachedResult =>
{
var tagHelperContent = new DefaultTagHelperContent();
tagHelperContent.SetContent("Something");

View File

@ -104,7 +104,7 @@ namespace Microsoft.AspNet.Mvc.TagHelpers
allAttributes,
items: new Dictionary<object, object>(),
uniqueId: "test",
getChildContentAsync: () => Task.FromResult<TagHelperContent>(result: null));
getChildContentAsync: useCachedResult => Task.FromResult<TagHelperContent>(result: null));
// Act
output.CopyHtmlAttribute(attributeNameToCopy, context);
@ -129,7 +129,7 @@ namespace Microsoft.AspNet.Mvc.TagHelpers
},
items: new Dictionary<object, object>(),
uniqueId: "test",
getChildContentAsync: () =>
getChildContentAsync: useCachedResult =>
{
var tagHelperContent = new DefaultTagHelperContent();
tagHelperContent.Append("Something");
@ -164,7 +164,7 @@ namespace Microsoft.AspNet.Mvc.TagHelpers
},
items: new Dictionary<object, object>(),
uniqueId: "test",
getChildContentAsync: () =>
getChildContentAsync: useCachedResult =>
{
var tagHelperContent = new DefaultTagHelperContent();
tagHelperContent.Append("Something Else");
@ -194,7 +194,7 @@ namespace Microsoft.AspNet.Mvc.TagHelpers
},
items: new Dictionary<object, object>(),
uniqueId: "test",
getChildContentAsync: () =>
getChildContentAsync: useCachedResult =>
{
var tagHelperContent = new DefaultTagHelperContent();
tagHelperContent.Append("Something");

View File

@ -126,7 +126,7 @@ namespace Microsoft.AspNet.Mvc.TagHelpers
Enumerable.Empty<IReadOnlyTagHelperAttribute>()),
items: new Dictionary<object, object>(),
uniqueId: "test",
getChildContentAsync: () =>
getChildContentAsync: useCachedResult =>
{
var tagHelperContent = new DefaultTagHelperContent();
tagHelperContent.SetContent("Something");

View File

@ -44,7 +44,7 @@ namespace Microsoft.AspNet.Mvc.TagHelpers
},
items: new Dictionary<object, object>(),
uniqueId: "test",
getChildContentAsync: () =>
getChildContentAsync: useCachedResult =>
{
var tagHelperContent = new DefaultTagHelperContent();
tagHelperContent.SetContent("Something");
@ -108,7 +108,7 @@ namespace Microsoft.AspNet.Mvc.TagHelpers
Enumerable.Empty<IReadOnlyTagHelperAttribute>()),
items: new Dictionary<object, object>(),
uniqueId: "test",
getChildContentAsync: () =>
getChildContentAsync: useCachedResult =>
{
var tagHelperContent = new DefaultTagHelperContent();
tagHelperContent.SetContent("Something");
@ -173,7 +173,7 @@ namespace Microsoft.AspNet.Mvc.TagHelpers
Enumerable.Empty<IReadOnlyTagHelperAttribute>()),
items: new Dictionary<object, object>(),
uniqueId: "test",
getChildContentAsync: () =>
getChildContentAsync: useCachedResult =>
{
var tagHelperContent = new DefaultTagHelperContent();
tagHelperContent.SetContent(childContent);
@ -233,7 +233,7 @@ namespace Microsoft.AspNet.Mvc.TagHelpers
Enumerable.Empty<IReadOnlyTagHelperAttribute>()),
items: new Dictionary<object, object>(),
uniqueId: "test",
getChildContentAsync: () =>
getChildContentAsync: useCachedResult =>
{
var tagHelperContent = new DefaultTagHelperContent();
tagHelperContent.SetContent(childContent);

View File

@ -40,7 +40,7 @@ namespace Microsoft.AspNet.Mvc.TagHelpers
Enumerable.Empty<IReadOnlyTagHelperAttribute>()),
items: new Dictionary<object, object>(),
uniqueId: "test",
getChildContentAsync: () =>
getChildContentAsync: useCachedResult =>
{
var tagHelperContent = new DefaultTagHelperContent();
tagHelperContent.SetContent("Something");