PR comment on c162209
- place `[HtmlAttributeNotBound]` on its own line - don't use (wonderful) shortcut syntax - @Eilon's comment https://github.com/aspnet/Mvc/pull/2452/files#r29162068
This commit is contained in:
parent
3c9456e2a3
commit
05ac641f9a
|
|
@ -24,7 +24,8 @@ namespace Microsoft.AspNet.Mvc.TagHelpers
|
||||||
private const string RouteAttributePrefix = "asp-route-";
|
private const string RouteAttributePrefix = "asp-route-";
|
||||||
private const string Href = "href";
|
private const string Href = "href";
|
||||||
|
|
||||||
[Activate, HtmlAttributeNotBound]
|
[Activate]
|
||||||
|
[HtmlAttributeNotBound]
|
||||||
public IHtmlGenerator Generator { get; set; }
|
public IHtmlGenerator Generator { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
|
||||||
|
|
@ -39,13 +39,15 @@ namespace Microsoft.AspNet.Mvc.TagHelpers
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or sets the <see cref="IMemoryCache"/> instance used to cache entries.
|
/// Gets or sets the <see cref="IMemoryCache"/> instance used to cache entries.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Activate, HtmlAttributeNotBound]
|
[Activate]
|
||||||
|
[HtmlAttributeNotBound]
|
||||||
public IMemoryCache MemoryCache { get; set; }
|
public IMemoryCache MemoryCache { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or sets the <see cref="ViewContext"/> for the current executing View.
|
/// Gets or sets the <see cref="ViewContext"/> for the current executing View.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Activate, HtmlAttributeNotBound]
|
[Activate]
|
||||||
|
[HtmlAttributeNotBound]
|
||||||
public ViewContext ViewContext { get; set; }
|
public ViewContext ViewContext { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
|
||||||
|
|
@ -25,7 +25,8 @@ namespace Microsoft.AspNet.Mvc.TagHelpers
|
||||||
/// </remarks>
|
/// </remarks>
|
||||||
public string Names { get; set; }
|
public string Names { get; set; }
|
||||||
|
|
||||||
[Activate, HtmlAttributeNotBound]
|
[Activate]
|
||||||
|
[HtmlAttributeNotBound]
|
||||||
public IHostingEnvironment HostingEnvironment { get; set; }
|
public IHostingEnvironment HostingEnvironment { get; set; }
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
|
|
|
||||||
|
|
@ -21,10 +21,12 @@ namespace Microsoft.AspNet.Mvc.TagHelpers
|
||||||
private const string RouteAttributePrefix = "asp-route-";
|
private const string RouteAttributePrefix = "asp-route-";
|
||||||
private const string HtmlActionAttributeName = "action";
|
private const string HtmlActionAttributeName = "action";
|
||||||
|
|
||||||
[Activate, HtmlAttributeNotBound]
|
[Activate]
|
||||||
|
[HtmlAttributeNotBound]
|
||||||
public ViewContext ViewContext { get; set; }
|
public ViewContext ViewContext { get; set; }
|
||||||
|
|
||||||
[Activate, HtmlAttributeNotBound]
|
[Activate]
|
||||||
|
[HtmlAttributeNotBound]
|
||||||
public IHtmlGenerator Generator { get; set; }
|
public IHtmlGenerator Generator { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
|
||||||
|
|
@ -62,10 +62,12 @@ namespace Microsoft.AspNet.Mvc.TagHelpers
|
||||||
{ "time", "{0:HH:mm:ss.fff}" },
|
{ "time", "{0:HH:mm:ss.fff}" },
|
||||||
};
|
};
|
||||||
|
|
||||||
[Activate, HtmlAttributeNotBound]
|
[Activate]
|
||||||
|
[HtmlAttributeNotBound]
|
||||||
public IHtmlGenerator Generator { get; set; }
|
public IHtmlGenerator Generator { get; set; }
|
||||||
|
|
||||||
[Activate, HtmlAttributeNotBound]
|
[Activate]
|
||||||
|
[HtmlAttributeNotBound]
|
||||||
public ViewContext ViewContext { get; set; }
|
public ViewContext ViewContext { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
|
||||||
|
|
@ -15,10 +15,12 @@ namespace Microsoft.AspNet.Mvc.TagHelpers
|
||||||
{
|
{
|
||||||
private const string ForAttributeName = "asp-for";
|
private const string ForAttributeName = "asp-for";
|
||||||
|
|
||||||
[Activate, HtmlAttributeNotBound]
|
[Activate]
|
||||||
|
[HtmlAttributeNotBound]
|
||||||
public ViewContext ViewContext { get; set; }
|
public ViewContext ViewContext { get; set; }
|
||||||
|
|
||||||
[Activate, HtmlAttributeNotBound]
|
[Activate]
|
||||||
|
[HtmlAttributeNotBound]
|
||||||
public IHtmlGenerator Generator { get; set; }
|
public IHtmlGenerator Generator { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
|
||||||
|
|
@ -180,26 +180,32 @@ namespace Microsoft.AspNet.Mvc.TagHelpers
|
||||||
[HtmlAttributeName(FallbackTestValueAttributeName)]
|
[HtmlAttributeName(FallbackTestValueAttributeName)]
|
||||||
public string FallbackTestValue { get; set; }
|
public string FallbackTestValue { get; set; }
|
||||||
|
|
||||||
[Activate, HtmlAttributeNotBound]
|
[Activate]
|
||||||
|
[HtmlAttributeNotBound]
|
||||||
public ILoggerFactory LoggerFactory { get; set; }
|
public ILoggerFactory LoggerFactory { get; set; }
|
||||||
|
|
||||||
// TODO: will remove LoggerFactory and activate logger once DI/hosting bug is fixed
|
// TODO: will remove LoggerFactory and activate logger once DI/hosting bug is fixed
|
||||||
[HtmlAttributeNotBound]
|
[HtmlAttributeNotBound]
|
||||||
public ILogger<LinkTagHelper> Logger { get; set; }
|
public ILogger<LinkTagHelper> Logger { get; set; }
|
||||||
|
|
||||||
[Activate, HtmlAttributeNotBound]
|
[Activate]
|
||||||
|
[HtmlAttributeNotBound]
|
||||||
public IHostingEnvironment HostingEnvironment { get; set; }
|
public IHostingEnvironment HostingEnvironment { get; set; }
|
||||||
|
|
||||||
[Activate, HtmlAttributeNotBound]
|
[Activate]
|
||||||
|
[HtmlAttributeNotBound]
|
||||||
public ViewContext ViewContext { get; set; }
|
public ViewContext ViewContext { get; set; }
|
||||||
|
|
||||||
[Activate, HtmlAttributeNotBound]
|
[Activate]
|
||||||
|
[HtmlAttributeNotBound]
|
||||||
public IMemoryCache Cache { get; set; }
|
public IMemoryCache Cache { get; set; }
|
||||||
|
|
||||||
[Activate, HtmlAttributeNotBound]
|
[Activate]
|
||||||
|
[HtmlAttributeNotBound]
|
||||||
public IHtmlEncoder HtmlEncoder { get; set; }
|
public IHtmlEncoder HtmlEncoder { get; set; }
|
||||||
|
|
||||||
[Activate, HtmlAttributeNotBound]
|
[Activate]
|
||||||
|
[HtmlAttributeNotBound]
|
||||||
public IJavaScriptStringEncoder JavaScriptEncoder { get; set; }
|
public IJavaScriptStringEncoder JavaScriptEncoder { get; set; }
|
||||||
|
|
||||||
// Internal for ease of use when testing.
|
// Internal for ease of use when testing.
|
||||||
|
|
|
||||||
|
|
@ -19,10 +19,12 @@ namespace Microsoft.AspNet.Mvc.TagHelpers
|
||||||
/// </remarks>
|
/// </remarks>
|
||||||
public class OptionTagHelper : TagHelper
|
public class OptionTagHelper : TagHelper
|
||||||
{
|
{
|
||||||
[Activate, HtmlAttributeNotBound]
|
[Activate]
|
||||||
|
[HtmlAttributeNotBound]
|
||||||
public IHtmlGenerator Generator { get; set; }
|
public IHtmlGenerator Generator { get; set; }
|
||||||
|
|
||||||
[Activate, HtmlAttributeNotBound]
|
[Activate]
|
||||||
|
[HtmlAttributeNotBound]
|
||||||
public ViewContext ViewContext { get; set; }
|
public ViewContext ViewContext { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
|
||||||
|
|
@ -149,26 +149,32 @@ namespace Microsoft.AspNet.Mvc.TagHelpers
|
||||||
[HtmlAttributeName(FallbackTestExpressionAttributeName)]
|
[HtmlAttributeName(FallbackTestExpressionAttributeName)]
|
||||||
public string FallbackTestExpression { get; set; }
|
public string FallbackTestExpression { get; set; }
|
||||||
|
|
||||||
[Activate, HtmlAttributeNotBound]
|
[Activate]
|
||||||
|
[HtmlAttributeNotBound]
|
||||||
public ILoggerFactory LoggerFactory { get; set; }
|
public ILoggerFactory LoggerFactory { get; set; }
|
||||||
|
|
||||||
// TODO: will remove LoggerFactory and activate logger once DI/hosting bug is fixed
|
// TODO: will remove LoggerFactory and activate logger once DI/hosting bug is fixed
|
||||||
[HtmlAttributeNotBound]
|
[HtmlAttributeNotBound]
|
||||||
public ILogger<ScriptTagHelper> Logger { get; set; }
|
public ILogger<ScriptTagHelper> Logger { get; set; }
|
||||||
|
|
||||||
[Activate, HtmlAttributeNotBound]
|
[Activate]
|
||||||
|
[HtmlAttributeNotBound]
|
||||||
public IHostingEnvironment HostingEnvironment { get; set; }
|
public IHostingEnvironment HostingEnvironment { get; set; }
|
||||||
|
|
||||||
[Activate, HtmlAttributeNotBound]
|
[Activate]
|
||||||
|
[HtmlAttributeNotBound]
|
||||||
public ViewContext ViewContext { get; set; }
|
public ViewContext ViewContext { get; set; }
|
||||||
|
|
||||||
[Activate, HtmlAttributeNotBound]
|
[Activate]
|
||||||
|
[HtmlAttributeNotBound]
|
||||||
public IMemoryCache Cache { get; set; }
|
public IMemoryCache Cache { get; set; }
|
||||||
|
|
||||||
[Activate, HtmlAttributeNotBound]
|
[Activate]
|
||||||
|
[HtmlAttributeNotBound]
|
||||||
public IHtmlEncoder HtmlEncoder { get; set; }
|
public IHtmlEncoder HtmlEncoder { get; set; }
|
||||||
|
|
||||||
[Activate, HtmlAttributeNotBound]
|
[Activate]
|
||||||
|
[HtmlAttributeNotBound]
|
||||||
public IJavaScriptStringEncoder JavaScriptEncoder { get; set; }
|
public IJavaScriptStringEncoder JavaScriptEncoder { get; set; }
|
||||||
|
|
||||||
// Internal for ease of use when testing.
|
// Internal for ease of use when testing.
|
||||||
|
|
|
||||||
|
|
@ -30,10 +30,12 @@ namespace Microsoft.AspNet.Mvc.TagHelpers
|
||||||
/// </remarks>
|
/// </remarks>
|
||||||
public static readonly string SelectedValuesFormDataKey = nameof(SelectTagHelper) + "-SelectedValues";
|
public static readonly string SelectedValuesFormDataKey = nameof(SelectTagHelper) + "-SelectedValues";
|
||||||
|
|
||||||
[Activate, HtmlAttributeNotBound]
|
[Activate]
|
||||||
|
[HtmlAttributeNotBound]
|
||||||
public IHtmlGenerator Generator { get; set; }
|
public IHtmlGenerator Generator { get; set; }
|
||||||
|
|
||||||
[Activate, HtmlAttributeNotBound]
|
[Activate]
|
||||||
|
[HtmlAttributeNotBound]
|
||||||
public ViewContext ViewContext { get; set; }
|
public ViewContext ViewContext { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,6 @@
|
||||||
|
|
||||||
using Microsoft.AspNet.Mvc.Rendering;
|
using Microsoft.AspNet.Mvc.Rendering;
|
||||||
using Microsoft.AspNet.Razor.Runtime.TagHelpers;
|
using Microsoft.AspNet.Razor.Runtime.TagHelpers;
|
||||||
using Microsoft.AspNet.Razor.TagHelpers;
|
|
||||||
|
|
||||||
namespace Microsoft.AspNet.Mvc.TagHelpers
|
namespace Microsoft.AspNet.Mvc.TagHelpers
|
||||||
{
|
{
|
||||||
|
|
@ -15,10 +14,12 @@ namespace Microsoft.AspNet.Mvc.TagHelpers
|
||||||
{
|
{
|
||||||
private const string ForAttributeName = "asp-for";
|
private const string ForAttributeName = "asp-for";
|
||||||
|
|
||||||
[Activate, HtmlAttributeNotBound]
|
[Activate]
|
||||||
|
[HtmlAttributeNotBound]
|
||||||
public IHtmlGenerator Generator { get; set; }
|
public IHtmlGenerator Generator { get; set; }
|
||||||
|
|
||||||
[Activate, HtmlAttributeNotBound]
|
[Activate]
|
||||||
|
[HtmlAttributeNotBound]
|
||||||
public ViewContext ViewContext { get; set; }
|
public ViewContext ViewContext { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
|
||||||
|
|
@ -16,10 +16,12 @@ namespace Microsoft.AspNet.Mvc.TagHelpers
|
||||||
{
|
{
|
||||||
private const string ValidationForAttributeName = "asp-validation-for";
|
private const string ValidationForAttributeName = "asp-validation-for";
|
||||||
|
|
||||||
[Activate, HtmlAttributeNotBound]
|
[Activate]
|
||||||
|
[HtmlAttributeNotBound]
|
||||||
public ViewContext ViewContext { get; set; }
|
public ViewContext ViewContext { get; set; }
|
||||||
|
|
||||||
[Activate, HtmlAttributeNotBound]
|
[Activate]
|
||||||
|
[HtmlAttributeNotBound]
|
||||||
public IHtmlGenerator Generator { get; set; }
|
public IHtmlGenerator Generator { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
|
||||||
|
|
@ -17,10 +17,12 @@ namespace Microsoft.AspNet.Mvc.TagHelpers
|
||||||
private const string ValidationSummaryAttributeName = "asp-validation-summary";
|
private const string ValidationSummaryAttributeName = "asp-validation-summary";
|
||||||
private ValidationSummary _validationSummary;
|
private ValidationSummary _validationSummary;
|
||||||
|
|
||||||
[Activate, HtmlAttributeNotBound]
|
[Activate]
|
||||||
|
[HtmlAttributeNotBound]
|
||||||
public ViewContext ViewContext { get; set; }
|
public ViewContext ViewContext { get; set; }
|
||||||
|
|
||||||
[Activate, HtmlAttributeNotBound]
|
[Activate]
|
||||||
|
[HtmlAttributeNotBound]
|
||||||
public IHtmlGenerator Generator { get; set; }
|
public IHtmlGenerator Generator { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,6 @@ using Microsoft.AspNet.Mvc.ModelBinding;
|
||||||
using Microsoft.AspNet.Mvc.Rendering;
|
using Microsoft.AspNet.Mvc.Rendering;
|
||||||
using Microsoft.AspNet.Razor.Runtime.TagHelpers;
|
using Microsoft.AspNet.Razor.Runtime.TagHelpers;
|
||||||
using Microsoft.AspNet.Routing;
|
using Microsoft.AspNet.Routing;
|
||||||
using Microsoft.Framework.DependencyInjection;
|
|
||||||
using Moq;
|
using Moq;
|
||||||
using Xunit;
|
using Xunit;
|
||||||
|
|
||||||
|
|
@ -147,7 +146,8 @@ namespace Microsoft.AspNet.Mvc.Razor
|
||||||
|
|
||||||
private class ServiceTagHelper : TagHelper
|
private class ServiceTagHelper : TagHelper
|
||||||
{
|
{
|
||||||
[Activate, HtmlAttributeNotBound]
|
[Activate]
|
||||||
|
[HtmlAttributeNotBound]
|
||||||
public MyService ActivatedService { get; set; }
|
public MyService ActivatedService { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -159,7 +159,8 @@ namespace Microsoft.AspNet.Mvc.Razor
|
||||||
|
|
||||||
private class ViewDataTagHelper : TagHelper
|
private class ViewDataTagHelper : TagHelper
|
||||||
{
|
{
|
||||||
[Activate, HtmlAttributeNotBound]
|
[Activate]
|
||||||
|
[HtmlAttributeNotBound]
|
||||||
public ViewDataDictionary ViewData { get; set; }
|
public ViewDataDictionary ViewData { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,8 @@ namespace TagHelpersWebSite.TagHelpers
|
||||||
{
|
{
|
||||||
public class ATagHelper : TagHelper
|
public class ATagHelper : TagHelper
|
||||||
{
|
{
|
||||||
[Activate, HtmlAttributeNotBound]
|
[Activate]
|
||||||
|
[HtmlAttributeNotBound]
|
||||||
public IUrlHelper UrlHelper { get; set; }
|
public IUrlHelper UrlHelper { get; set; }
|
||||||
|
|
||||||
public string Controller { get; set; }
|
public string Controller { get; set; }
|
||||||
|
|
|
||||||
|
|
@ -25,7 +25,8 @@ namespace TagHelpersWebSite.TagHelpers
|
||||||
|
|
||||||
public string Style { get; set; }
|
public string Style { get; set; }
|
||||||
|
|
||||||
[Activate, HtmlAttributeNotBound]
|
[Activate]
|
||||||
|
[HtmlAttributeNotBound]
|
||||||
public ViewContext ViewContext { get; set; }
|
public ViewContext ViewContext { get; set; }
|
||||||
|
|
||||||
public override void Process(TagHelperContext context, TagHelperOutput output)
|
public override void Process(TagHelperContext context, TagHelperOutput output)
|
||||||
|
|
|
||||||
|
|
@ -25,7 +25,8 @@ namespace MvcSample.Web.Components
|
||||||
|
|
||||||
public int Count { get; set; }
|
public int Count { get; set; }
|
||||||
|
|
||||||
[Activate, HtmlAttributeNotBound]
|
[Activate]
|
||||||
|
[HtmlAttributeNotBound]
|
||||||
public ViewContext ViewContext { get; set; }
|
public ViewContext ViewContext { get; set; }
|
||||||
|
|
||||||
public int Order { get; } = 0;
|
public int Order { get; } = 0;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue