React to IHeaderDictionary changes.

This commit is contained in:
Chris R 2015-10-12 11:38:24 -07:00
parent 5a1c120392
commit 6e347724b5
1 changed files with 34 additions and 0 deletions

View File

@ -271,6 +271,40 @@ namespace Microsoft.AspNet.Mvc.TagHelpers
}
}
private static void AddStringCollectionKey(
StringBuilder builder,
string keyName,
string value,
IHeaderDictionary sourceCollection)
{
if (!string.IsNullOrEmpty(value))
{
// keyName(param1=value1|param2=value2)
builder.Append(CacheKeyTokenSeparator)
.Append(keyName)
.Append("(");
var tokenFound = false;
foreach (var item in Tokenize(value))
{
tokenFound = true;
builder.Append(item)
.Append(CacheKeyTokenSeparator)
.Append(sourceCollection[item])
.Append(CacheKeyTokenSeparator);
}
if (tokenFound)
{
// Remove the trailing separator
builder.Length -= CacheKeyTokenSeparator.Length;
}
builder.Append(")");
}
}
private void AddVaryByRouteKey(StringBuilder builder)
{
var tokenFound = false;