Call `IHtmlHelper` methods from extension methods
- don't call other extension methods - #847 line 7 - remove extension methods that do nothing but pass through to the interface method - weren't exactly ambiguous (interface method wins) but were useless
This commit is contained in:
parent
56d66c090e
commit
4c5aa15f0b
|
|
@ -107,7 +107,7 @@ namespace Microsoft.AspNet.Mvc.Rendering
|
||||||
|
|
||||||
public static HtmlString TextBox([NotNull] this IHtmlHelper htmlHelper, string name)
|
public static HtmlString TextBox([NotNull] this IHtmlHelper htmlHelper, string name)
|
||||||
{
|
{
|
||||||
return TextBox(htmlHelper, name, value: null);
|
return htmlHelper.TextBox(name, value: null, format: null, htmlAttributes: null);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static HtmlString TextBox(
|
public static HtmlString TextBox(
|
||||||
|
|
@ -115,7 +115,7 @@ namespace Microsoft.AspNet.Mvc.Rendering
|
||||||
string name,
|
string name,
|
||||||
object value)
|
object value)
|
||||||
{
|
{
|
||||||
return TextBox(htmlHelper, name, value, format: null);
|
return htmlHelper.TextBox(name, value, format: null, htmlAttributes: null);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static HtmlString TextBox(
|
public static HtmlString TextBox(
|
||||||
|
|
@ -124,7 +124,7 @@ namespace Microsoft.AspNet.Mvc.Rendering
|
||||||
object value,
|
object value,
|
||||||
string format)
|
string format)
|
||||||
{
|
{
|
||||||
return TextBox(htmlHelper, name, value, format, htmlAttributes: null);
|
return htmlHelper.TextBox(name, value, format, htmlAttributes: null);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static HtmlString TextBox(
|
public static HtmlString TextBox(
|
||||||
|
|
@ -133,41 +133,25 @@ namespace Microsoft.AspNet.Mvc.Rendering
|
||||||
object value,
|
object value,
|
||||||
object htmlAttributes)
|
object htmlAttributes)
|
||||||
{
|
{
|
||||||
return TextBox(htmlHelper, name, value, format: null, htmlAttributes: htmlAttributes);
|
return htmlHelper.TextBox(name, value, format: null, htmlAttributes: htmlAttributes);
|
||||||
}
|
|
||||||
|
|
||||||
public static HtmlString TextBox(
|
|
||||||
[NotNull] this IHtmlHelper htmlHelper,
|
|
||||||
string name,
|
|
||||||
object value,
|
|
||||||
string format,
|
|
||||||
object htmlAttributes)
|
|
||||||
{
|
|
||||||
return htmlHelper.TextBox(name, value, format, htmlAttributes);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static HtmlString TextBoxFor<TModel, TProperty>([NotNull] this IHtmlHelper<TModel> htmlHelper,
|
public static HtmlString TextBoxFor<TModel, TProperty>([NotNull] this IHtmlHelper<TModel> htmlHelper,
|
||||||
[NotNull] Expression<Func<TModel, TProperty>> expression)
|
[NotNull] Expression<Func<TModel, TProperty>> expression)
|
||||||
{
|
{
|
||||||
return TextBoxFor(htmlHelper, expression, format: null);
|
return htmlHelper.TextBoxFor(expression, format: null, htmlAttributes: null);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static HtmlString TextBoxFor<TModel, TProperty>([NotNull] this IHtmlHelper<TModel> htmlHelper,
|
public static HtmlString TextBoxFor<TModel, TProperty>([NotNull] this IHtmlHelper<TModel> htmlHelper,
|
||||||
[NotNull] Expression<Func<TModel, TProperty>> expression, string format)
|
[NotNull] Expression<Func<TModel, TProperty>> expression, string format)
|
||||||
{
|
{
|
||||||
return TextBoxFor(htmlHelper, expression, format, htmlAttributes: null);
|
return htmlHelper.TextBoxFor(expression, format, htmlAttributes: null);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static HtmlString TextBoxFor<TModel, TProperty>([NotNull] this IHtmlHelper<TModel> htmlHelper,
|
public static HtmlString TextBoxFor<TModel, TProperty>([NotNull] this IHtmlHelper<TModel> htmlHelper,
|
||||||
[NotNull] Expression<Func<TModel, TProperty>> expression, object htmlAttributes)
|
[NotNull] Expression<Func<TModel, TProperty>> expression, object htmlAttributes)
|
||||||
{
|
{
|
||||||
return TextBoxFor(htmlHelper, expression, format: null, htmlAttributes: htmlAttributes);
|
return htmlHelper.TextBoxFor(expression, format: null, htmlAttributes: htmlAttributes);
|
||||||
}
|
|
||||||
|
|
||||||
public static HtmlString TextBoxFor<TModel, TProperty>([NotNull] this IHtmlHelper<TModel> htmlHelper,
|
|
||||||
[NotNull] Expression<Func<TModel, TProperty>> expression, string format, object htmlAttributes)
|
|
||||||
{
|
|
||||||
return htmlHelper.TextBoxFor(expression, format: format, htmlAttributes: htmlAttributes);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static HtmlString TextArea([NotNull] this IHtmlHelper htmlHelper,
|
public static HtmlString TextArea([NotNull] this IHtmlHelper htmlHelper,
|
||||||
|
|
@ -194,12 +178,6 @@ namespace Microsoft.AspNet.Mvc.Rendering
|
||||||
return htmlHelper.TextArea(name, value, rows: 0, columns: 0, htmlAttributes: htmlAttributes);
|
return htmlHelper.TextArea(name, value, rows: 0, columns: 0, htmlAttributes: htmlAttributes);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static HtmlString TextArea([NotNull] this IHtmlHelper htmlHelper,
|
|
||||||
string name, string value, int rows, int columns, object htmlAttributes)
|
|
||||||
{
|
|
||||||
return htmlHelper.TextArea(name, value, rows, columns, htmlAttributes);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static HtmlString TextAreaFor<TModel, TProperty>([NotNull] this IHtmlHelper<TModel> htmlHelper,
|
public static HtmlString TextAreaFor<TModel, TProperty>([NotNull] this IHtmlHelper<TModel> htmlHelper,
|
||||||
[NotNull] Expression<Func<TModel, TProperty>> expression)
|
[NotNull] Expression<Func<TModel, TProperty>> expression)
|
||||||
{
|
{
|
||||||
|
|
@ -211,11 +189,5 @@ namespace Microsoft.AspNet.Mvc.Rendering
|
||||||
{
|
{
|
||||||
return htmlHelper.TextAreaFor(expression, rows: 0, columns: 0, htmlAttributes: htmlAttributes);
|
return htmlHelper.TextAreaFor(expression, rows: 0, columns: 0, htmlAttributes: htmlAttributes);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static HtmlString TextAreaFor<TModel, TProperty>([NotNull] this IHtmlHelper<TModel> htmlHelper,
|
|
||||||
[NotNull] Expression<Func<TModel, TProperty>> expression, int rows, int columns, object htmlAttributes)
|
|
||||||
{
|
|
||||||
return htmlHelper.TextAreaFor(expression, rows, columns, htmlAttributes);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -42,7 +42,7 @@ namespace Microsoft.AspNet.Mvc.Rendering
|
||||||
|
|
||||||
public static HtmlString LabelForModel([NotNull] this IHtmlHelper html)
|
public static HtmlString LabelForModel([NotNull] this IHtmlHelper html)
|
||||||
{
|
{
|
||||||
return LabelForModel(html, labelText: null);
|
return html.Label(expression: null, labelText: null, htmlAttributes: null);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static HtmlString LabelForModel([NotNull] this IHtmlHelper html, string labelText)
|
public static HtmlString LabelForModel([NotNull] this IHtmlHelper html, string labelText)
|
||||||
|
|
|
||||||
|
|
@ -188,25 +188,5 @@ namespace Microsoft.AspNet.Mvc.Rendering
|
||||||
routeValues: routeValues,
|
routeValues: routeValues,
|
||||||
htmlAttributes: htmlAttributes);
|
htmlAttributes: htmlAttributes);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static HtmlString RouteLink(
|
|
||||||
[NotNull] this IHtmlHelper htmlHelper,
|
|
||||||
[NotNull] string linkText,
|
|
||||||
string routeName,
|
|
||||||
string protocol,
|
|
||||||
string hostName,
|
|
||||||
string fragment,
|
|
||||||
object routeValues,
|
|
||||||
object htmlAttributes)
|
|
||||||
{
|
|
||||||
return htmlHelper.RouteLink(
|
|
||||||
linkText,
|
|
||||||
routeName,
|
|
||||||
protocol,
|
|
||||||
hostName,
|
|
||||||
fragment,
|
|
||||||
routeValues,
|
|
||||||
htmlAttributes);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -44,15 +44,6 @@ namespace Microsoft.AspNet.Mvc.Rendering
|
||||||
return htmlHelper.ValidationMessage(expression, message, htmlAttributes, tag: null);
|
return htmlHelper.ValidationMessage(expression, message, htmlAttributes, tag: null);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static HtmlString ValidationMessage([NotNull] this IHtmlHelper htmlHelper,
|
|
||||||
string expression,
|
|
||||||
string message,
|
|
||||||
object htmlAttributes,
|
|
||||||
string tag)
|
|
||||||
{
|
|
||||||
return htmlHelper.ValidationMessage(expression, message, htmlAttributes, tag);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static HtmlString ValidationMessageFor<TModel, TProperty>([NotNull] this IHtmlHelper<TModel> htmlHelper,
|
public static HtmlString ValidationMessageFor<TModel, TProperty>([NotNull] this IHtmlHelper<TModel> htmlHelper,
|
||||||
[NotNull] Expression<Func<TModel, TProperty>> expression)
|
[NotNull] Expression<Func<TModel, TProperty>> expression)
|
||||||
{
|
{
|
||||||
|
|
@ -82,15 +73,6 @@ namespace Microsoft.AspNet.Mvc.Rendering
|
||||||
return htmlHelper.ValidationMessageFor(expression, message, htmlAttributes: null, tag: tag);
|
return htmlHelper.ValidationMessageFor(expression, message, htmlAttributes: null, tag: tag);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static HtmlString ValidationMessageFor<TModel, TProperty>([NotNull] this IHtmlHelper<TModel> htmlHelper,
|
|
||||||
[NotNull] Expression<Func<TModel, TProperty>> expression,
|
|
||||||
string message,
|
|
||||||
object htmlAttributes,
|
|
||||||
string tag)
|
|
||||||
{
|
|
||||||
return htmlHelper.ValidationMessageFor(expression, message, htmlAttributes, tag);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static HtmlString ValidationSummary([NotNull] this IHtmlHelper htmlHelper)
|
public static HtmlString ValidationSummary([NotNull] this IHtmlHelper htmlHelper)
|
||||||
{
|
{
|
||||||
return htmlHelper.ValidationSummary(excludePropertyErrors: false,
|
return htmlHelper.ValidationSummary(excludePropertyErrors: false,
|
||||||
|
|
@ -168,14 +150,5 @@ namespace Microsoft.AspNet.Mvc.Rendering
|
||||||
{
|
{
|
||||||
return htmlHelper.ValidationSummary(excludePropertyErrors, message, htmlAttributes, tag: null);
|
return htmlHelper.ValidationSummary(excludePropertyErrors, message, htmlAttributes, tag: null);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static HtmlString ValidationSummary([NotNull] this IHtmlHelper htmlHelper,
|
|
||||||
bool excludePropertyErrors,
|
|
||||||
string message,
|
|
||||||
object htmlAttributes,
|
|
||||||
string tag)
|
|
||||||
{
|
|
||||||
return htmlHelper.ValidationSummary(excludePropertyErrors, message, htmlAttributes, tag);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue