1 write to Name
Microsoft.AspNetCore.Razor (1)
TagHelpers\TagHelperAttribute.cs (1)
49
Name
= name;
225 references to Name
Microsoft.AspNetCore.Mvc.Razor (5)
TagHelpers\UrlResolutionTagHelper.cs (5)
142
/// <see cref="TagHelperAttribute.
Name
"/> is <paramref name="attributeName"/>.
157
if (!string.Equals(attribute.
Name
, attributeName, StringComparison.OrdinalIgnoreCase))
167
attribute.
Name
,
194
attribute.
Name
,
202
attribute.
Name
,
Microsoft.AspNetCore.Mvc.Razor.Test (18)
RazorPageTest.cs (9)
997
Assert.Equal("someattr", htmlAttribute.
Name
, StringComparer.Ordinal);
1004
Assert.Equal("someattr", allAttribute.
Name
, StringComparer.Ordinal);
1042
Assert.Equal("someattr", htmlAttribute.
Name
, StringComparer.Ordinal);
1049
Assert.Equal("someattr", allAttribute.
Name
, StringComparer.Ordinal);
1088
Assert.Equal("someattr", htmlAttribute.
Name
, StringComparer.Ordinal);
1095
Assert.Equal("someattr", allAttribute.
Name
, StringComparer.Ordinal);
1130
Assert.Equal("someattr", attribute.
Name
, StringComparer.Ordinal);
1158
Assert.Equal("someattr", htmlAttribute.
Name
, StringComparer.Ordinal);
1163
Assert.Equal("someattr", allAttribute.
Name
, StringComparer.Ordinal);
src\Shared\Razor\CaseSensitiveBoundAttributeComparer.cs (2)
29
string.Equals(attributeX.
Name
, attributeY.
Name
, StringComparison.Ordinal) &&
TagHelpers\UrlResolutionTagHelperTest.cs (7)
88
Assert.Equal("href", attribute.
Name
, StringComparer.Ordinal);
130
Assert.Equal("href", attribute.
Name
, StringComparer.Ordinal);
190
Assert.Equal("href", attribute.
Name
, StringComparer.Ordinal);
248
Assert.Equal("href", attribute.
Name
, StringComparer.Ordinal);
304
Assert.Equal("href", attribute.
Name
, StringComparer.Ordinal);
335
Assert.Equal("href", attribute.
Name
, StringComparer.Ordinal);
430
Assert.Equal("href", attribute.
Name
, StringComparer.Ordinal);
Microsoft.AspNetCore.Mvc.TagHelpers (18)
LinkTagHelper.cs (5)
283
existingAttribute.
Name
,
380
if (string.Equals(attribute.
Name
, HrefAttributeName, StringComparison.OrdinalIgnoreCase))
385
if (SuppressFallbackIntegrity && string.Equals(attribute.
Name
, IntegrityAttributeName, StringComparison.OrdinalIgnoreCase))
501
if (string.Equals(attribute.
Name
, HrefAttributeName, StringComparison.OrdinalIgnoreCase))
505
AppendVersionedHref(attribute.
Name
, href, builder);
ScriptTagHelper.cs (6)
296
existingAttribute.
Name
,
377
if (!attribute.
Name
.Equals(SrcAttributeName, StringComparison.OrdinalIgnoreCase))
379
if (SuppressFallbackIntegrity && string.Equals(IntegrityAttributeName, attribute.
Name
, StringComparison.OrdinalIgnoreCase))
390
WriteVersionedSrc(attribute.
Name
, src, attribute.ValueStyle, StringWriter);
491
if (!attribute.
Name
.Equals(SrcAttributeName, StringComparison.OrdinalIgnoreCase))
499
AppendVersionedSrc(attribute.
Name
, src, attribute.ValueStyle, builder);
TagHelperOutputExtensions.cs (7)
60
context.AllAttributes[i].
Name
,
102
classAttribute.
Name
,
181
classAttribute.
Name
,
249
tagHelperOutput.Attributes.SetAttribute(classAttribute.
Name
, joinedClasses);
297
var previousName = allAttributes[i].
Name
;
312
var nextName = allAttributes[i].
Name
;
331
if (string.Equals(name, attributes[i].
Name
, StringComparison.OrdinalIgnoreCase))
Microsoft.AspNetCore.Mvc.TagHelpers.Test (65)
AnchorTagHelperTest.cs (2)
79
var attribute = Assert.Single(output.Attributes, attr => attr.
Name
.Equals("id"));
81
attribute = Assert.Single(output.Attributes, attr => attr.
Name
.Equals("href"));
FormActionTagHelperTest.cs (8)
73
Assert.Equal("id", attribute.
Name
, StringComparer.Ordinal);
78
Assert.Equal("formaction", attribute.
Name
, StringComparer.Ordinal);
147
Assert.Equal("id", attribute.
Name
, StringComparer.Ordinal);
152
Assert.Equal("formaction", attribute.
Name
, StringComparer.Ordinal);
249
Assert.Equal("formaction", attribute.
Name
);
307
Assert.Equal("formaction", attribute.
Name
);
380
Assert.Equal("formaction", attribute.
Name
);
433
Assert.Equal("formaction", attribute.
Name
);
FormTagHelperTest.cs (10)
115
var attribute = Assert.Single(output.Attributes, attr => attr.
Name
.Equals("method"));
117
attribute = Assert.Single(output.Attributes, attr => attr.
Name
.Equals("action"));
169
var attribute = Assert.Single(output.Attributes, attr => attr.
Name
.Equals("method"));
171
attribute = Assert.Single(output.Attributes, attr => attr.
Name
.Equals("action"));
227
var attribute = Assert.Single(output.Attributes, attr => attr.
Name
.Equals("action"));
285
var attribute = Assert.Single(output.Attributes, attr => attr.
Name
.Equals("action"));
357
var attribute = Assert.Single(output.Attributes, attr => attr.
Name
.Equals("id"));
359
attribute = Assert.Single(output.Attributes, attr => attr.
Name
.Equals("method"));
361
attribute = Assert.Single(output.Attributes, attr => attr.
Name
.Equals("action"));
619
var attribute = Assert.Single(output.Attributes, attr => attr.
Name
.Equals("action"));
ImageTagHelperTest.cs (6)
126
Assert.Equal(expectedAttribute.
Name
, actualAttribute.
Name
);
160
var srcAttribute = Assert.Single(output.Attributes, attr => attr.
Name
.Equals("src"));
212
var srcAttribute = Assert.Single(output.Attributes, attr => attr.
Name
.Equals("src"));
255
var srcAttribute = Assert.Single(output.Attributes, attr => attr.
Name
.Equals("src"));
287
var srcAttribute = Assert.Single(output.Attributes, attr => attr.
Name
.Equals("src"));
LinkTagHelperTest.cs (3)
443
Assert.Equal("rel", output.Attributes[0].
Name
);
444
Assert.Equal("href", output.Attributes[1].
Name
);
445
Assert.Equal("data-extra", output.Attributes[2].
Name
);
ScriptTagHelperTest.cs (3)
524
Assert.Equal("data-extra", output.Attributes[0].
Name
);
525
Assert.Equal("src", output.Attributes[1].
Name
);
526
Assert.Equal("data-more", output.Attributes[2].
Name
);
SelectTagHelperTest.cs (2)
775
Assert.Equal("name", attribute.
Name
);
824
Assert.Equal("name", attribute.
Name
);
src\Shared\Razor\CaseSensitiveBoundAttributeComparer.cs (2)
29
string.Equals(attributeX.
Name
, attributeY.
Name
, StringComparison.Ordinal) &&
TagHelperOutputExtensionsTest.cs (12)
569
.Where(item => item.
Name
.StartsWith("route-", StringComparison.OrdinalIgnoreCase))
596
.Where(item => item.
Name
.StartsWith("route-", StringComparison.OrdinalIgnoreCase));
623
.Where(item => item.
Name
.StartsWith("route-", StringComparison.OrdinalIgnoreCase));
914
var attribute = Assert.Single(tagHelperOutput.Attributes, attr => attr.
Name
.Equals("class"));
916
attribute = Assert.Single(tagHelperOutput.Attributes, attr => attr.
Name
.Equals("class2"));
963
var attribute = Assert.Single(tagHelperOutput.Attributes, attr => attr.
Name
.Equals("class"));
965
attribute = Assert.Single(tagHelperOutput.Attributes, attr => attr.
Name
.Equals("for"));
986
var classAttribute = Assert.Single(tagHelperOutput.Attributes, attr => attr.
Name
.Equals("class"));
1008
var classAttribute = Assert.Single(tagHelperOutput.Attributes, attr => attr.
Name
.Equals("class"));
1034
var classAttribute = Assert.Single(tagHelperOutput.Attributes, attr => attr.
Name
.Equals("class"));
1100
var classAttribute = Assert.Single(tagHelperOutput.Attributes, attr => attr.
Name
.Equals("class"));
1144
var classAttribute = Assert.Single(tagHelperOutput.Attributes, attr => attr.
Name
.Equals("class"));
TextAreaTagHelperTest.cs (1)
231
Assert.Equal("name", attribute.
Name
);
ValidationMessageTagHelperTest.cs (12)
74
var attribute = Assert.Single(output.Attributes, attr => attr.
Name
.Equals("id"));
76
attribute = Assert.Single(output.Attributes, attr => attr.
Name
.Equals("class"));
78
attribute = Assert.Single(output.Attributes, attr => attr.
Name
.Equals("data-valmsg-for"));
80
attribute = Assert.Single(output.Attributes, attr => attr.
Name
.Equals("data-valmsg-replace"));
180
Assert.Equal("data-valmsg-for", attribute.
Name
);
185
Assert.Equal("class", attribute.
Name
);
190
Assert.Equal("data-valmsg-replace", attribute.
Name
);
229
Assert.Equal("data-valmsg-for", attribute.
Name
);
347
var attribute = Assert.Single(output.Attributes, attr => attr.
Name
.Equals("data-foo"));
349
attribute = Assert.Single(output.Attributes, attr => attr.
Name
.Equals("data-hello"));
409
var attribute = Assert.Single(output.Attributes, attr => attr.
Name
.Equals("data-foo"));
411
attribute = Assert.Single(output.Attributes, attr => attr.
Name
.Equals("data-hello"));
ValidationSummaryTagHelperTest.cs (4)
255
var attribute = Assert.Single(output.Attributes, attr => attr.
Name
.Equals("class"));
446
Assert.Equal("anything", attribute.
Name
);
451
Assert.Equal("data-foo", attribute.
Name
);
456
Assert.Equal("data-hello", attribute.
Name
);
Microsoft.AspNetCore.Razor (40)
TagHelpers\ReadOnlyTagHelperAttributeList.cs (19)
33
/// Gets the first <see cref="TagHelperAttribute"/> with <see cref="TagHelperAttribute.
Name
"/>
37
/// The <see cref="TagHelperAttribute.
Name
"/> of the <see cref="TagHelperAttribute"/> to get.
39
/// <returns>The first <see cref="TagHelperAttribute"/> with <see cref="TagHelperAttribute.
Name
"/>
67
/// Determines whether a <see cref="TagHelperAttribute"/> with <see cref="TagHelperAttribute.
Name
"/>
70
/// <param name="name">The <see cref="TagHelperAttribute.
Name
"/> of the
74
/// <see cref="TagHelperAttribute.
Name
"/> exists in the collection; otherwise, <c>false</c>.
83
/// Retrieves the first <see cref="TagHelperAttribute"/> with <see cref="TagHelperAttribute.
Name
"/>
86
/// <param name="name">The <see cref="TagHelperAttribute.
Name
"/> of the
89
/// <see cref="TagHelperAttribute.
Name
"/> matching <paramref name="name"/>, if found; otherwise,
92
/// <see cref="TagHelperAttribute.
Name
"/> exists in the collection; otherwise, <c>false</c>.</returns>
105
/// <see cref="TagHelperAttribute.
Name
"/> matching <paramref name="name"/>.
107
/// <param name="name">The <see cref="TagHelperAttribute.
Name
"/> of the
110
/// <see cref="TagHelperAttribute.
Name
"/> matching <paramref name="name"/>.</param>
112
/// <see cref="TagHelperAttribute.
Name
"/> exists in the collection; otherwise, <c>false</c>.</returns>
142
/// Searches for a <see cref="TagHelperAttribute"/> who's <see cref="TagHelperAttribute.
Name
"/>
146
/// <param name="name">The <see cref="TagHelperAttribute.
Name
"/> to locate in the collection.</param>
171
/// <see cref="TagHelperAttribute.
Name
"/>.</param>
174
/// <see cref="TagHelperAttribute.
Name
"/>.</returns>
179
return string.Equals(name, attribute.
Name
, StringComparison.OrdinalIgnoreCase);
TagHelpers\TagHelperAttribute.cs (10)
19
/// <param name="name">The <see cref="
Name
"/> of the attribute.</param>
29
/// <param name="name">The <see cref="
Name
"/> of the attribute.</param>
40
/// <param name="name">The <see cref="
Name
"/> of the new instance.</param>
70
/// <remarks><see cref="
Name
"/> is compared case-insensitively.</remarks>
75
string.Equals(
Name
, other.
Name
, StringComparison.OrdinalIgnoreCase) &&
86
writer.Write(
Name
);
121
destination.AppendHtml(
Name
);
166
destination.AppendHtml(
Name
);
218
hashCode.Add(
Name
, StringComparer.Ordinal);
TagHelpers\TagHelperAttributeList.cs (11)
43
/// <paramref name="value"/>'s <see cref="TagHelperAttribute.
Name
"/> must not be <c>null</c>.
60
/// Replaces the first <see cref="TagHelperAttribute"/> with <see cref="TagHelperAttribute.
Name
"/> matching
65
/// The <see cref="TagHelperAttribute.
Name
"/> of the <see cref="TagHelperAttribute"/> to set.
78
/// Replaces the first <see cref="TagHelperAttribute"/> with <see cref="TagHelperAttribute.
Name
"/> matching
79
/// <paramref name="attribute"/>'s <see cref="TagHelperAttribute.
Name
"/> and removes any additional matching
86
/// <remarks><paramref name="attribute"/>'s <see cref="TagHelperAttribute.
Name
"/> is compared
97
if (NameEquals(attribute.
Name
, Items[i]))
127
/// <param name="name">The <see cref="TagHelperAttribute.
Name
"/> of the attribute to add.</param>
153
/// <paramref name="attribute"/>s <see cref="TagHelperAttribute.
Name
"/> is compared case-insensitively.
169
/// Removes all <see cref="TagHelperAttribute"/>s with <see cref="TagHelperAttribute.
Name
"/> matching
173
/// The <see cref="TagHelperAttribute.
Name
"/> of <see cref="TagHelperAttribute"/>s to remove.
Microsoft.AspNetCore.Razor.Runtime.Test (4)
Runtime\TagHelpers\TagHelperExecutionContextTest.cs (2)
133
Assert.Equal("Another attribute", attribute.
Name
);
184
Assert.Equal("Another attribute", attribute.
Name
);
src\Shared\Razor\CaseSensitiveBoundAttributeComparer.cs (2)
29
string.Equals(attributeX.
Name
, attributeY.
Name
, StringComparison.Ordinal) &&
Microsoft.AspNetCore.Razor.Test (74)
src\Shared\Razor\CaseSensitiveBoundAttributeComparer.cs (2)
29
string.Equals(attributeX.
Name
, attributeY.
Name
, StringComparison.Ordinal) &&
TagHelpers\ReadOnlyTagHelperAttributeListTest.cs (72)
23
{ new[] { first }, first.
Name
, 0 },
24
{ new[] { first, second }, first.
Name
, 0 },
25
{ new[] { first, second }, second.
Name
.ToUpperInvariant(), 1 },
26
{ new[] { first, second, third}, second.
Name
, 1 },
27
{ new[] { first, second, third }, third.
Name
.ToLowerInvariant(), 2 },
28
{ new[] { first, first, second, third}, first.
Name
, 0 },
32
{ new[] { first, first, first}, first.
Name
+ "bad", -1 },
221
{ new[] { A }, new TagHelperAttribute(A.
Name
, A.Value), true },
224
{ new[] { A, B }, new TagHelperAttribute(A.
Name
, A.Value), true },
227
{ new[] { A, B }, new TagHelperAttribute(B.
Name
, B.Value), true },
230
{ new[] { A, B, C }, new TagHelperAttribute(B.
Name
, B.Value), true },
233
{ new[] { A, B, C }, new TagHelperAttribute(C.
Name
, C.Value), true },
236
{ new[] { A }, new TagHelperAttribute(A.
Name
, "different value"), false },
239
{ new[] { A, B }, new TagHelperAttribute(A.
Name
, "different value"), false },
241
{ new[] { A, B }, new TagHelperAttribute(B.
Name
, "different value"), false },
244
{ new[] { A, B, C }, new TagHelperAttribute(B.
Name
, "different value"), false },
246
{ new[] { A, B, C }, new TagHelperAttribute(C.
Name
, "different value"), false },
251
{ new[] { A, B, A2, C }, new TagHelperAttribute(A.
Name
, A.Value), true },
254
{ new[] { B, A2, A }, new TagHelperAttribute(A.
Name
, A.Value), true },
257
{ new[] { B, A2, A, C }, new TagHelperAttribute(A.
Name
, A.Value), true },
260
{ new[] { A, A3 }, new TagHelperAttribute(A.
Name
, A.Value), true },
263
{ new[] { A3, A }, new TagHelperAttribute(A3.
Name
, A3.Value), true },
266
{ new[] { A, A2, A3 }, new TagHelperAttribute(A.
Name
, A.Value), true },
269
{ new[] { C, B, A3, A }, new TagHelperAttribute(A3.
Name
, A3.Value), true },
272
{ new[] { A, B, A2, C }, new TagHelperAttribute(A.
Name
, A3.Value), false },
275
{ new[] { B, A2, A }, new TagHelperAttribute(A.
Name
, A3.Value), false },
278
{ new[] { B, A2, A, C }, new TagHelperAttribute(A.
Name
, A3.Value), false },
281
{ new[] { A, A3 }, new TagHelperAttribute(A.
Name
, A2.Value), false },
284
{ new[] { A3, A }, new TagHelperAttribute(A3.
Name
, A2.Value), false },
287
{ new[] { A, A2, A3 }, new TagHelperAttribute(A.
Name
, B.Value), false },
290
{ new[] { C, B, A3, A }, new TagHelperAttribute(A3.
Name
, A2.Value), false },
328
{ new[] { A }, A.
Name
, true },
330
{ new[] { A, B }, A.
Name
, true },
332
{ new[] { A, B }, B.
Name
, true },
334
{ new[] { A, B, C }, B.
Name
, true },
336
{ new[] { A, B, C }, C.
Name
, true },
338
{ new[] { A }, B.
Name
, false },
339
{ new[] { A, B }, C.
Name
, false },
343
{ new[] { A, B, A2, C }, A.
Name
, true },
345
{ new[] { B, A2, A }, A2.
Name
, true },
347
{ new[] { B, A2, A, C }, A.
Name
, true },
349
{ new[] { A, A3 }, A.
Name
, true },
351
{ new[] { A, A2, A3 }, A.
Name
, true },
353
{ new[] { C, B, A3, A }, A3.
Name
, true },
356
{ new[] { B, A2, A }, C.
Name
, false },
360
{ new[] { A, A3 }, B.
Name
, false },
362
{ new[] { A3, A }, B.
Name
, false },
364
{ new[] { A, A2, A3 }, B.
Name
, false },
405
{ new[] { A }, new TagHelperAttribute(A.
Name
, A.Value), 0 },
408
{ new[] { A, B }, new TagHelperAttribute(A.
Name
, A.Value), 0 },
411
{ new[] { A, B }, new TagHelperAttribute(B.
Name
, B.Value), 1 },
414
{ new[] { A, B, C }, new TagHelperAttribute(B.
Name
, B.Value), 1 },
417
{ new[] { A, B, C }, new TagHelperAttribute(C.
Name
, C.Value), 2 },
420
{ new[] { A }, new TagHelperAttribute(A.
Name
, "different value"), -1 },
423
{ new[] { A, B }, new TagHelperAttribute(A.
Name
, "different value"), -1 },
425
{ new[] { A, B }, new TagHelperAttribute(B.
Name
, "different value"), -1 },
428
{ new[] { A, B, C }, new TagHelperAttribute(B.
Name
, "different value"), -1 },
430
{ new[] { A, B, C }, new TagHelperAttribute(C.
Name
, "different value"), -1 },
435
{ new[] { A, B, A2, C }, new TagHelperAttribute(A.
Name
, A.Value), 0 },
438
{ new[] { B, A2, A }, new TagHelperAttribute(A.
Name
, A.Value), 2 },
441
{ new[] { B, A2, A, C }, new TagHelperAttribute(A.
Name
, A.Value), 2 },
444
{ new[] { A, A3 }, new TagHelperAttribute(A.
Name
, A.Value), 0 },
447
{ new[] { A3, A }, new TagHelperAttribute(A3.
Name
, A3.Value), 0 },
450
{ new[] { A, A2, A3 }, new TagHelperAttribute(A.
Name
, A.Value), 0 },
453
{ new[] { C, B, A3, A }, new TagHelperAttribute(A3.
Name
, A3.Value), 2 },
456
{ new[] { A, B, A2, C }, new TagHelperAttribute(A.
Name
, A3.Value), -1 },
459
{ new[] { B, A2, A }, new TagHelperAttribute(A.
Name
, A3.Value), -1 },
462
{ new[] { B, A2, A, C }, new TagHelperAttribute(A.
Name
, A3.Value), -1 },
465
{ new[] { A, A3 }, new TagHelperAttribute(A.
Name
, A2.Value), -1 },
468
{ new[] { A3, A }, new TagHelperAttribute(A3.
Name
, A2.Value), -1 },
471
{ new[] { A, A2, A3 }, new TagHelperAttribute(A.
Name
, B.Value), -1 },
474
{ new[] { C, B, A3, A }, new TagHelperAttribute(A3.
Name
, A2.Value), -1 },
TagHelpersWebSite (1)
TagHelpers\ATagHelper.cs (1)
34
var methodParameters = output.Attributes.ToDictionary(attribute => attribute.
Name
,