diff --git a/src/Microsoft.AspNet.Html.Abstractions/HtmlContentBuilder.cs b/src/Microsoft.AspNet.Html.Abstractions/HtmlContentBuilder.cs index 0f6fbabc4c..198cd0fb38 100644 --- a/src/Microsoft.AspNet.Html.Abstractions/HtmlContentBuilder.cs +++ b/src/Microsoft.AspNet.Html.Abstractions/HtmlContentBuilder.cs @@ -36,7 +36,7 @@ namespace Microsoft.AspNet.Html.Abstractions /// /// The list of entries. The will use this list without making a copy. /// - public HtmlContentBuilder(List entries) + public HtmlContentBuilder(IList entries) { if (entries == null) { @@ -53,7 +53,7 @@ namespace Microsoft.AspNet.Html.Abstractions // a wrapper when encoded strings are used. // // internal for testing. - internal List Entries { get; } + internal IList Entries { get; } /// public IHtmlContentBuilder Append(string unencoded) @@ -109,8 +109,10 @@ namespace Microsoft.AspNet.Html.Abstractions throw new ArgumentNullException(nameof(encoder)); } - foreach (var entry in Entries) + for (var i = 0; i < Entries.Count; i++) { + var entry = Entries[i]; + var entryAsString = entry as string; if (entryAsString != null) {