Fix warning as error

This commit is contained in:
Ryan Brandenburg 2017-03-14 12:01:55 -07:00
parent 2ffaa88830
commit 82d87df166
3 changed files with 4 additions and 22 deletions

View File

@ -35,24 +35,6 @@ namespace Microsoft.AspNetCore.Mvc.Razor
/// <remarks>Returns null if <see cref="ViewContext"/> is null.</remarks>
public ITempDataDictionary TempData => ViewContext?.TempData;
/// <summary>
/// Format an error message about using an indexer when the tag helper property is <c>null</c>.
/// </summary>
/// <param name="attributeName">Name of the HTML attribute associated with the indexer.</param>
/// <param name="tagHelperTypeName">Full name of the tag helper <see cref="Type"/>.</param>
/// <param name="propertyName">Dictionary property in the tag helper.</param>
/// <returns>An error message about using an indexer when the tag helper property is <c>null</c>.</returns>
public static string InvalidTagHelperIndexerAssignment(
string attributeName,
string tagHelperTypeName,
string propertyName)
{
return Resources.FormatRazorPage_InvalidTagHelperIndexerAssignment(
attributeName,
tagHelperTypeName,
propertyName);
}
/// <summary>
/// In a Razor layout page, renders the portion of a content page that is not within a named section.
/// </summary>

View File

@ -47,7 +47,7 @@ namespace Microsoft.AspNetCore.Mvc.FunctionalTests
var content = await response.Content.ReadAsStringAsync();
Assert.Equal(HttpStatusCode.OK, response.StatusCode);
Assert.Equal("<a href=\"/Show?id=2\">Post title</a>", content.Trim());
Assert.StartsWith("<a href=\"/Show?id=2\">Post title</a>", content.Trim());
}
[Fact]

View File

@ -1,9 +1,6 @@
@page
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
<!-- Tests that RazorPage includes InvalidTagHelperIndexerAssignment which is called when the page has an indexer
Issue https://github.com/aspnet/Mvc/issues/5920 -->
@functions {
public class Post
{
@ -14,3 +11,6 @@
}
<a asp-route-page="/Show" asp-route-id="@post.Id">@post.Title</a>
<!-- Tests that RazorPage includes InvalidTagHelperIndexerAssignment which is called when the page has an indexer
Issue https://github.com/aspnet/Mvc/issues/5920 -->