diff --git a/src/Razor/Microsoft.NET.Sdk.Razor/test/IntegrationTests/BuildIntegrationTest.cs b/src/Razor/Microsoft.NET.Sdk.Razor/test/IntegrationTests/BuildIntegrationTest.cs index 6ba9ac9be8..5c0562d7dc 100644 --- a/src/Razor/Microsoft.NET.Sdk.Razor/test/IntegrationTests/BuildIntegrationTest.cs +++ b/src/Razor/Microsoft.NET.Sdk.Razor/test/IntegrationTests/BuildIntegrationTest.cs @@ -245,12 +245,13 @@ namespace Microsoft.AspNetCore.Razor.Design.IntegrationTests Assert.FileExists(result, OutputPath, "SimpleMvc.deps.json"); var depsFilePath = Path.Combine(Project.DirectoryPath, OutputPath, "SimpleMvc.deps.json"); var dependencyContext = ReadDependencyContext(depsFilePath); + // Pick a couple of libraries and ensure they have some compile references - var packageReference = dependencyContext.CompileLibraries.First(l => l.Name == "Microsoft.AspNetCore.Html.Abstractions"); + var packageReference = dependencyContext.CompileLibraries.First(l => l.Name == "Microsoft.NETCore.App"); Assert.NotEmpty(packageReference.Assemblies); var projectReference = dependencyContext.CompileLibraries.First(l => l.Name == "SimpleMvc"); - Assert.NotEmpty(packageReference.Assemblies); + Assert.NotEmpty(projectReference.Assemblies); Assert.Contains(customDefine, dependencyContext.CompilationOptions.Defines); } diff --git a/src/Razor/Microsoft.NET.Sdk.Razor/test/Microsoft.NET.Sdk.Razor.Test.csproj b/src/Razor/Microsoft.NET.Sdk.Razor/test/Microsoft.NET.Sdk.Razor.Test.csproj index 9aee6cab0f..65b089fc15 100644 --- a/src/Razor/Microsoft.NET.Sdk.Razor/test/Microsoft.NET.Sdk.Razor.Test.csproj +++ b/src/Razor/Microsoft.NET.Sdk.Razor/test/Microsoft.NET.Sdk.Razor.Test.csproj @@ -29,7 +29,6 @@ - diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.Test.MvcShim.ClassLib/Microsoft.AspNetCore.Razor.Test.MvcShim.ClassLib.csproj b/src/Razor/test/Microsoft.AspNetCore.Razor.Test.MvcShim.ClassLib/Microsoft.AspNetCore.Razor.Test.MvcShim.ClassLib.csproj index bbfde1da9b..8ce2215ec2 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.Test.MvcShim.ClassLib/Microsoft.AspNetCore.Razor.Test.MvcShim.ClassLib.csproj +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.Test.MvcShim.ClassLib/Microsoft.AspNetCore.Razor.Test.MvcShim.ClassLib.csproj @@ -5,9 +5,9 @@ - - + + diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.Test.MvcShim.Version1_X/Microsoft.AspNetCore.Html/IHtmlContent.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.Test.MvcShim.Version1_X/Microsoft.AspNetCore.Html/IHtmlContent.cs new file mode 100644 index 0000000000..2e9a0f19e2 --- /dev/null +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.Test.MvcShim.Version1_X/Microsoft.AspNetCore.Html/IHtmlContent.cs @@ -0,0 +1,22 @@ +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. + +using System.IO; +using System.Text.Encodings.Web; + +namespace Microsoft.AspNetCore.Html +{ + /// + /// HTML content which can be written to a TextWriter. + /// + public interface IHtmlContent + { + /// + /// Writes the content by encoding it with the specified + /// to the specified . + /// + /// The to which the content is written. + /// The which encodes the content to be written. + void WriteTo(TextWriter writer, HtmlEncoder encoder); + } +} \ No newline at end of file diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.Test.MvcShim.Version1_X/Microsoft.AspNetCore.Html/IHtmlContentBuilder.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.Test.MvcShim.Version1_X/Microsoft.AspNetCore.Html/IHtmlContentBuilder.cs new file mode 100644 index 0000000000..3cf3a65aab --- /dev/null +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.Test.MvcShim.Version1_X/Microsoft.AspNetCore.Html/IHtmlContentBuilder.cs @@ -0,0 +1,40 @@ +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. + +namespace Microsoft.AspNetCore.Html +{ + /// + /// A builder for HTML content. + /// + public interface IHtmlContentBuilder : IHtmlContentContainer + { + /// + /// Appends an instance. + /// + /// The to append. + /// The . + IHtmlContentBuilder AppendHtml(IHtmlContent content); + + /// + /// Appends a value. The value is treated as unencoded as-provided, and will be HTML + /// encoded before writing to output. + /// + /// The to append. + /// The . + IHtmlContentBuilder Append(string unencoded); + + /// + /// Appends an HTML encoded value. The value is treated as HTML encoded as-provided, and + /// no further encoding will be performed. + /// + /// The HTML encoded to append. + /// The . + IHtmlContentBuilder AppendHtml(string encoded); + + /// + /// Clears the content. + /// + /// The . + IHtmlContentBuilder Clear(); + } +} \ No newline at end of file diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.Test.MvcShim.Version1_X/Microsoft.AspNetCore.Html/IHtmlContentContainer.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.Test.MvcShim.Version1_X/Microsoft.AspNetCore.Html/IHtmlContentContainer.cs new file mode 100644 index 0000000000..0cddf6e0d6 --- /dev/null +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.Test.MvcShim.Version1_X/Microsoft.AspNetCore.Html/IHtmlContentContainer.cs @@ -0,0 +1,30 @@ +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. + +namespace Microsoft.AspNetCore.Html +{ + /// + /// Defines a contract for instances made up of several components which + /// can be copied into an . + /// + public interface IHtmlContentContainer : IHtmlContent + { + /// + /// Copies the contained content of this into . + /// + /// The . + void CopyTo(IHtmlContentBuilder builder); + + /// + /// + /// Moves the contained content of this into . + /// + /// + /// After is called, this instance should be left + /// in an empty state. + /// + /// + /// The . + void MoveTo(IHtmlContentBuilder builder); + } +} \ No newline at end of file diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.Test.MvcShim.Version1_X/Microsoft.AspNetCore.Razor.TagHelpers/TagHelperContent.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.Test.MvcShim.Version1_X/Microsoft.AspNetCore.Razor.TagHelpers/TagHelperContent.cs index 7a6d380215..b144bd3689 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.Test.MvcShim.Version1_X/Microsoft.AspNetCore.Razor.TagHelpers/TagHelperContent.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.Test.MvcShim.Version1_X/Microsoft.AspNetCore.Razor.TagHelpers/TagHelperContent.cs @@ -30,7 +30,6 @@ namespace Microsoft.AspNetCore.Razor.TagHelpers /// A reference to this instance after the set operation has completed. public TagHelperContent SetHtmlContent(IHtmlContent htmlContent) { - HtmlContentBuilderExtensions.SetHtmlContent(this, htmlContent); return this; } @@ -44,7 +43,6 @@ namespace Microsoft.AspNetCore.Razor.TagHelpers /// A reference to this instance after the set operation has completed. public TagHelperContent SetContent(string unencoded) { - HtmlContentBuilderExtensions.SetContent(this, unencoded); return this; } @@ -58,7 +56,6 @@ namespace Microsoft.AspNetCore.Razor.TagHelpers /// A reference to this instance after the set operation has completed. public TagHelperContent SetHtmlContent(string encoded) { - HtmlContentBuilderExtensions.SetHtmlContent(this, encoded); return this; } @@ -96,7 +93,6 @@ namespace Microsoft.AspNetCore.Razor.TagHelpers /// A reference to this instance after the append operation has completed. public TagHelperContent AppendFormat(string format, params object[] args) { - HtmlContentBuilderExtensions.AppendFormat(this, null, format, args); return this; } @@ -113,7 +109,6 @@ namespace Microsoft.AspNetCore.Razor.TagHelpers /// A reference to this instance after the append operation has completed. public TagHelperContent AppendFormat(IFormatProvider provider, string format, params object[] args) { - HtmlContentBuilderExtensions.AppendFormat(this, provider, format, args); return this; } diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.Test.MvcShim.Version1_X/Microsoft.AspNetCore.Razor.Test.MvcShim.Version1_X.csproj b/src/Razor/test/Microsoft.AspNetCore.Razor.Test.MvcShim.Version1_X/Microsoft.AspNetCore.Razor.Test.MvcShim.Version1_X.csproj index bd2e0104cc..b3c5ef2c7b 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.Test.MvcShim.Version1_X/Microsoft.AspNetCore.Razor.Test.MvcShim.Version1_X.csproj +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.Test.MvcShim.Version1_X/Microsoft.AspNetCore.Razor.Test.MvcShim.Version1_X.csproj @@ -6,8 +6,8 @@ - + diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.Test.MvcShim.Version2_X/Microsoft.AspNetCore.Html/HtmlString.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.Test.MvcShim.Version2_X/Microsoft.AspNetCore.Html/HtmlString.cs new file mode 100644 index 0000000000..6cb37dec3b --- /dev/null +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.Test.MvcShim.Version2_X/Microsoft.AspNetCore.Html/HtmlString.cs @@ -0,0 +1,61 @@ +// Copyright (c) .NET Foundation. 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.Text.Encodings.Web; + +namespace Microsoft.AspNetCore.Html +{ + /// + /// An implementation that wraps an HTML encoded . + /// + public class HtmlString : IHtmlContent + { + /// + /// An instance for . + /// + public static readonly HtmlString NewLine = new HtmlString(Environment.NewLine); + + /// + /// An instance for . + /// + public static readonly HtmlString Empty = new HtmlString(string.Empty); + + /// + /// Creates a new . + /// + /// The HTML encoded value. + public HtmlString(string value) + { + Value = value; + } + + /// + /// Gets the HTML encoded value. + /// + public string Value { get; } + + /// + public void WriteTo(TextWriter writer, HtmlEncoder encoder) + { + if (writer == null) + { + throw new ArgumentNullException(nameof(writer)); + } + + if (encoder == null) + { + throw new ArgumentNullException(nameof(encoder)); + } + + writer.Write(Value); + } + + /// + public override string ToString() + { + return Value ?? string.Empty; + } + } +} \ No newline at end of file diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.Test.MvcShim.Version2_X/Microsoft.AspNetCore.Html/IHtmlContent.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.Test.MvcShim.Version2_X/Microsoft.AspNetCore.Html/IHtmlContent.cs new file mode 100644 index 0000000000..2e9a0f19e2 --- /dev/null +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.Test.MvcShim.Version2_X/Microsoft.AspNetCore.Html/IHtmlContent.cs @@ -0,0 +1,22 @@ +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. + +using System.IO; +using System.Text.Encodings.Web; + +namespace Microsoft.AspNetCore.Html +{ + /// + /// HTML content which can be written to a TextWriter. + /// + public interface IHtmlContent + { + /// + /// Writes the content by encoding it with the specified + /// to the specified . + /// + /// The to which the content is written. + /// The which encodes the content to be written. + void WriteTo(TextWriter writer, HtmlEncoder encoder); + } +} \ No newline at end of file diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.Test.MvcShim.Version2_X/Microsoft.AspNetCore.Html/IHtmlContentBuilder.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.Test.MvcShim.Version2_X/Microsoft.AspNetCore.Html/IHtmlContentBuilder.cs new file mode 100644 index 0000000000..3cf3a65aab --- /dev/null +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.Test.MvcShim.Version2_X/Microsoft.AspNetCore.Html/IHtmlContentBuilder.cs @@ -0,0 +1,40 @@ +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. + +namespace Microsoft.AspNetCore.Html +{ + /// + /// A builder for HTML content. + /// + public interface IHtmlContentBuilder : IHtmlContentContainer + { + /// + /// Appends an instance. + /// + /// The to append. + /// The . + IHtmlContentBuilder AppendHtml(IHtmlContent content); + + /// + /// Appends a value. The value is treated as unencoded as-provided, and will be HTML + /// encoded before writing to output. + /// + /// The to append. + /// The . + IHtmlContentBuilder Append(string unencoded); + + /// + /// Appends an HTML encoded value. The value is treated as HTML encoded as-provided, and + /// no further encoding will be performed. + /// + /// The HTML encoded to append. + /// The . + IHtmlContentBuilder AppendHtml(string encoded); + + /// + /// Clears the content. + /// + /// The . + IHtmlContentBuilder Clear(); + } +} \ No newline at end of file diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.Test.MvcShim.Version2_X/Microsoft.AspNetCore.Html/IHtmlContentContainer.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.Test.MvcShim.Version2_X/Microsoft.AspNetCore.Html/IHtmlContentContainer.cs new file mode 100644 index 0000000000..0cddf6e0d6 --- /dev/null +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.Test.MvcShim.Version2_X/Microsoft.AspNetCore.Html/IHtmlContentContainer.cs @@ -0,0 +1,30 @@ +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. + +namespace Microsoft.AspNetCore.Html +{ + /// + /// Defines a contract for instances made up of several components which + /// can be copied into an . + /// + public interface IHtmlContentContainer : IHtmlContent + { + /// + /// Copies the contained content of this into . + /// + /// The . + void CopyTo(IHtmlContentBuilder builder); + + /// + /// + /// Moves the contained content of this into . + /// + /// + /// After is called, this instance should be left + /// in an empty state. + /// + /// + /// The . + void MoveTo(IHtmlContentBuilder builder); + } +} \ No newline at end of file diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.Test.MvcShim.Version2_X/Microsoft.AspNetCore.Razor.TagHelpers/TagHelperContent.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.Test.MvcShim.Version2_X/Microsoft.AspNetCore.Razor.TagHelpers/TagHelperContent.cs index 7a6d380215..b144bd3689 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.Test.MvcShim.Version2_X/Microsoft.AspNetCore.Razor.TagHelpers/TagHelperContent.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.Test.MvcShim.Version2_X/Microsoft.AspNetCore.Razor.TagHelpers/TagHelperContent.cs @@ -30,7 +30,6 @@ namespace Microsoft.AspNetCore.Razor.TagHelpers /// A reference to this instance after the set operation has completed. public TagHelperContent SetHtmlContent(IHtmlContent htmlContent) { - HtmlContentBuilderExtensions.SetHtmlContent(this, htmlContent); return this; } @@ -44,7 +43,6 @@ namespace Microsoft.AspNetCore.Razor.TagHelpers /// A reference to this instance after the set operation has completed. public TagHelperContent SetContent(string unencoded) { - HtmlContentBuilderExtensions.SetContent(this, unencoded); return this; } @@ -58,7 +56,6 @@ namespace Microsoft.AspNetCore.Razor.TagHelpers /// A reference to this instance after the set operation has completed. public TagHelperContent SetHtmlContent(string encoded) { - HtmlContentBuilderExtensions.SetHtmlContent(this, encoded); return this; } @@ -96,7 +93,6 @@ namespace Microsoft.AspNetCore.Razor.TagHelpers /// A reference to this instance after the append operation has completed. public TagHelperContent AppendFormat(string format, params object[] args) { - HtmlContentBuilderExtensions.AppendFormat(this, null, format, args); return this; } @@ -113,7 +109,6 @@ namespace Microsoft.AspNetCore.Razor.TagHelpers /// A reference to this instance after the append operation has completed. public TagHelperContent AppendFormat(IFormatProvider provider, string format, params object[] args) { - HtmlContentBuilderExtensions.AppendFormat(this, provider, format, args); return this; } diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.Test.MvcShim.Version2_X/Microsoft.AspNetCore.Razor.Test.MvcShim.Version2_X.csproj b/src/Razor/test/Microsoft.AspNetCore.Razor.Test.MvcShim.Version2_X/Microsoft.AspNetCore.Razor.Test.MvcShim.Version2_X.csproj index bd2e0104cc..b3c5ef2c7b 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.Test.MvcShim.Version2_X/Microsoft.AspNetCore.Razor.Test.MvcShim.Version2_X.csproj +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.Test.MvcShim.Version2_X/Microsoft.AspNetCore.Razor.Test.MvcShim.Version2_X.csproj @@ -6,8 +6,8 @@ - + diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.Test.MvcShim/Microsoft.AspNetCore.Html/HtmlString.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.Test.MvcShim/Microsoft.AspNetCore.Html/HtmlString.cs new file mode 100644 index 0000000000..6cb37dec3b --- /dev/null +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.Test.MvcShim/Microsoft.AspNetCore.Html/HtmlString.cs @@ -0,0 +1,61 @@ +// Copyright (c) .NET Foundation. 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.Text.Encodings.Web; + +namespace Microsoft.AspNetCore.Html +{ + /// + /// An implementation that wraps an HTML encoded . + /// + public class HtmlString : IHtmlContent + { + /// + /// An instance for . + /// + public static readonly HtmlString NewLine = new HtmlString(Environment.NewLine); + + /// + /// An instance for . + /// + public static readonly HtmlString Empty = new HtmlString(string.Empty); + + /// + /// Creates a new . + /// + /// The HTML encoded value. + public HtmlString(string value) + { + Value = value; + } + + /// + /// Gets the HTML encoded value. + /// + public string Value { get; } + + /// + public void WriteTo(TextWriter writer, HtmlEncoder encoder) + { + if (writer == null) + { + throw new ArgumentNullException(nameof(writer)); + } + + if (encoder == null) + { + throw new ArgumentNullException(nameof(encoder)); + } + + writer.Write(Value); + } + + /// + public override string ToString() + { + return Value ?? string.Empty; + } + } +} \ No newline at end of file diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.Test.MvcShim/Microsoft.AspNetCore.Html/IHtmlContent.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.Test.MvcShim/Microsoft.AspNetCore.Html/IHtmlContent.cs new file mode 100644 index 0000000000..2e9a0f19e2 --- /dev/null +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.Test.MvcShim/Microsoft.AspNetCore.Html/IHtmlContent.cs @@ -0,0 +1,22 @@ +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. + +using System.IO; +using System.Text.Encodings.Web; + +namespace Microsoft.AspNetCore.Html +{ + /// + /// HTML content which can be written to a TextWriter. + /// + public interface IHtmlContent + { + /// + /// Writes the content by encoding it with the specified + /// to the specified . + /// + /// The to which the content is written. + /// The which encodes the content to be written. + void WriteTo(TextWriter writer, HtmlEncoder encoder); + } +} \ No newline at end of file diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.Test.MvcShim/Microsoft.AspNetCore.Html/IHtmlContentBuilder.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.Test.MvcShim/Microsoft.AspNetCore.Html/IHtmlContentBuilder.cs new file mode 100644 index 0000000000..3cf3a65aab --- /dev/null +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.Test.MvcShim/Microsoft.AspNetCore.Html/IHtmlContentBuilder.cs @@ -0,0 +1,40 @@ +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. + +namespace Microsoft.AspNetCore.Html +{ + /// + /// A builder for HTML content. + /// + public interface IHtmlContentBuilder : IHtmlContentContainer + { + /// + /// Appends an instance. + /// + /// The to append. + /// The . + IHtmlContentBuilder AppendHtml(IHtmlContent content); + + /// + /// Appends a value. The value is treated as unencoded as-provided, and will be HTML + /// encoded before writing to output. + /// + /// The to append. + /// The . + IHtmlContentBuilder Append(string unencoded); + + /// + /// Appends an HTML encoded value. The value is treated as HTML encoded as-provided, and + /// no further encoding will be performed. + /// + /// The HTML encoded to append. + /// The . + IHtmlContentBuilder AppendHtml(string encoded); + + /// + /// Clears the content. + /// + /// The . + IHtmlContentBuilder Clear(); + } +} \ No newline at end of file diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.Test.MvcShim/Microsoft.AspNetCore.Html/IHtmlContentContainer.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.Test.MvcShim/Microsoft.AspNetCore.Html/IHtmlContentContainer.cs new file mode 100644 index 0000000000..0cddf6e0d6 --- /dev/null +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.Test.MvcShim/Microsoft.AspNetCore.Html/IHtmlContentContainer.cs @@ -0,0 +1,30 @@ +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. + +namespace Microsoft.AspNetCore.Html +{ + /// + /// Defines a contract for instances made up of several components which + /// can be copied into an . + /// + public interface IHtmlContentContainer : IHtmlContent + { + /// + /// Copies the contained content of this into . + /// + /// The . + void CopyTo(IHtmlContentBuilder builder); + + /// + /// + /// Moves the contained content of this into . + /// + /// + /// After is called, this instance should be left + /// in an empty state. + /// + /// + /// The . + void MoveTo(IHtmlContentBuilder builder); + } +} \ No newline at end of file diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.Test.MvcShim/Microsoft.AspNetCore.Razor.TagHelpers/TagHelperContent.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.Test.MvcShim/Microsoft.AspNetCore.Razor.TagHelpers/TagHelperContent.cs index 7a6d380215..b144bd3689 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.Test.MvcShim/Microsoft.AspNetCore.Razor.TagHelpers/TagHelperContent.cs +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.Test.MvcShim/Microsoft.AspNetCore.Razor.TagHelpers/TagHelperContent.cs @@ -30,7 +30,6 @@ namespace Microsoft.AspNetCore.Razor.TagHelpers /// A reference to this instance after the set operation has completed. public TagHelperContent SetHtmlContent(IHtmlContent htmlContent) { - HtmlContentBuilderExtensions.SetHtmlContent(this, htmlContent); return this; } @@ -44,7 +43,6 @@ namespace Microsoft.AspNetCore.Razor.TagHelpers /// A reference to this instance after the set operation has completed. public TagHelperContent SetContent(string unencoded) { - HtmlContentBuilderExtensions.SetContent(this, unencoded); return this; } @@ -58,7 +56,6 @@ namespace Microsoft.AspNetCore.Razor.TagHelpers /// A reference to this instance after the set operation has completed. public TagHelperContent SetHtmlContent(string encoded) { - HtmlContentBuilderExtensions.SetHtmlContent(this, encoded); return this; } @@ -96,7 +93,6 @@ namespace Microsoft.AspNetCore.Razor.TagHelpers /// A reference to this instance after the append operation has completed. public TagHelperContent AppendFormat(string format, params object[] args) { - HtmlContentBuilderExtensions.AppendFormat(this, null, format, args); return this; } @@ -113,7 +109,6 @@ namespace Microsoft.AspNetCore.Razor.TagHelpers /// A reference to this instance after the append operation has completed. public TagHelperContent AppendFormat(IFormatProvider provider, string format, params object[] args) { - HtmlContentBuilderExtensions.AppendFormat(this, provider, format, args); return this; } diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.Test.MvcShim/Microsoft.AspNetCore.Razor.Test.MvcShim.csproj b/src/Razor/test/Microsoft.AspNetCore.Razor.Test.MvcShim/Microsoft.AspNetCore.Razor.Test.MvcShim.csproj index 10bebabe02..868c485056 100644 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.Test.MvcShim/Microsoft.AspNetCore.Razor.Test.MvcShim.csproj +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.Test.MvcShim/Microsoft.AspNetCore.Razor.Test.MvcShim.csproj @@ -6,9 +6,9 @@ - - + + diff --git a/src/Razor/test/testassets/AppWithP2PReference/AppWithP2PReference.csproj b/src/Razor/test/testassets/AppWithP2PReference/AppWithP2PReference.csproj index 271eb90067..bbd86a5772 100644 --- a/src/Razor/test/testassets/AppWithP2PReference/AppWithP2PReference.csproj +++ b/src/Razor/test/testassets/AppWithP2PReference/AppWithP2PReference.csproj @@ -27,7 +27,6 @@ - diff --git a/src/Razor/test/testassets/ClassLibrary/ClassLibrary.csproj b/src/Razor/test/testassets/ClassLibrary/ClassLibrary.csproj index fdb58e05fe..036f56d5cb 100644 --- a/src/Razor/test/testassets/ClassLibrary/ClassLibrary.csproj +++ b/src/Razor/test/testassets/ClassLibrary/ClassLibrary.csproj @@ -30,7 +30,6 @@ - diff --git a/src/Razor/test/testassets/ClassLibrary2/ClassLibrary2.csproj b/src/Razor/test/testassets/ClassLibrary2/ClassLibrary2.csproj index 4d4cd2f2a3..eaf99c9257 100644 --- a/src/Razor/test/testassets/ClassLibrary2/ClassLibrary2.csproj +++ b/src/Razor/test/testassets/ClassLibrary2/ClassLibrary2.csproj @@ -27,7 +27,6 @@ - diff --git a/src/Razor/test/testassets/LargeProject/LargeProject.csproj b/src/Razor/test/testassets/LargeProject/LargeProject.csproj index e2cdd3ae0f..0581e93450 100644 --- a/src/Razor/test/testassets/LargeProject/LargeProject.csproj +++ b/src/Razor/test/testassets/LargeProject/LargeProject.csproj @@ -24,7 +24,6 @@ - diff --git a/src/Razor/test/testassets/MvcWithComponents/MvcWithComponents.csproj b/src/Razor/test/testassets/MvcWithComponents/MvcWithComponents.csproj index 9de30c05d9..d89f94bc3e 100644 --- a/src/Razor/test/testassets/MvcWithComponents/MvcWithComponents.csproj +++ b/src/Razor/test/testassets/MvcWithComponents/MvcWithComponents.csproj @@ -25,7 +25,6 @@ - diff --git a/src/Razor/test/testassets/SimpleMvc/SimpleMvc.csproj b/src/Razor/test/testassets/SimpleMvc/SimpleMvc.csproj index 160e4d5686..12fca67a75 100644 --- a/src/Razor/test/testassets/SimpleMvc/SimpleMvc.csproj +++ b/src/Razor/test/testassets/SimpleMvc/SimpleMvc.csproj @@ -24,7 +24,6 @@ - diff --git a/src/Razor/test/testassets/SimpleMvcFSharp/SimpleMvcFSharp.fsproj b/src/Razor/test/testassets/SimpleMvcFSharp/SimpleMvcFSharp.fsproj index c972b84e4b..4edd0713ca 100644 --- a/src/Razor/test/testassets/SimpleMvcFSharp/SimpleMvcFSharp.fsproj +++ b/src/Razor/test/testassets/SimpleMvcFSharp/SimpleMvcFSharp.fsproj @@ -29,7 +29,6 @@ - diff --git a/src/Razor/test/testassets/SimplePages/SimplePages.csproj b/src/Razor/test/testassets/SimplePages/SimplePages.csproj index afc2b469d0..858eeeb71e 100644 --- a/src/Razor/test/testassets/SimplePages/SimplePages.csproj +++ b/src/Razor/test/testassets/SimplePages/SimplePages.csproj @@ -24,7 +24,6 @@ -