Fixes #4471 - Don't call Enum.ToString()

This commit is contained in:
Ryan Nowak 2016-04-13 17:01:11 -07:00
parent 67e18c70cc
commit a73db1a9bd
2 changed files with 3 additions and 3 deletions

View File

@ -229,7 +229,7 @@ namespace Microsoft.AspNetCore.Mvc.TagHelpers
output.PostContent.AppendHtml(tagBuilder.InnerHtml);
}
if (string.Equals(Method, FormMethod.Get.ToString(), StringComparison.OrdinalIgnoreCase))
if (string.Equals(Method, "get", StringComparison.OrdinalIgnoreCase))
{
antiforgeryDefault = false;
}

View File

@ -249,7 +249,7 @@ namespace Microsoft.AspNetCore.Mvc.ViewFeatures
{
defaultMethod = true;
}
else if (string.Equals(method, FormMethod.Post.ToString(), StringComparison.OrdinalIgnoreCase))
else if (string.Equals(method, "post", StringComparison.OrdinalIgnoreCase))
{
defaultMethod = true;
}
@ -1104,7 +1104,7 @@ namespace Microsoft.AspNetCore.Mvc.ViewFeatures
if (string.IsNullOrEmpty(method))
{
// Occurs only when called from a tag helper.
method = FormMethod.Post.ToString().ToLowerInvariant();
method = "post";
}
// For tag helpers, htmlAttributes will be null; replaceExisting value does not matter.