-
Notifications
You must be signed in to change notification settings - Fork 224
Added a check for property bag in tag helper descriptor comparer. #824
Conversation
Hi @cjqian, I'm your friendly neighborhood .NET Foundation Pull Request Bot (You can call me DNFBOT). Thanks for your contribution! The agreement was validated by .NET Foundation and real humans are currently evaluating your PR. TTYL, DNFBOT; |
@@ -61,7 +62,8 @@ public virtual bool Equals(TagHelperDescriptor descriptorX, TagHelperDescriptor | |||
descriptorX.AllowedChildren.OrderBy(child => child, StringComparer.OrdinalIgnoreCase), | |||
descriptorY.AllowedChildren.OrderBy(child => child, StringComparer.OrdinalIgnoreCase), | |||
StringComparer.OrdinalIgnoreCase))) && | |||
descriptorX.TagStructure == descriptorY.TagStructure; | |||
descriptorX.TagStructure == descriptorY.TagStructure && | |||
descriptorX.PropertyBag.OrderBy(x => x.Key).SequenceEqual(descriptorY.PropertyBag.OrderBy(y => y.Key)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Do Enumerable.SequenceEqual to stay consistent with the above.
- Provide Comparer in both order bys
propertyX
,propertyY
⌚ |
🆙 📅 |
descriptorX.TagStructure == descriptorY.TagStructure; | ||
descriptorX.TagStructure == descriptorY.TagStructure && | ||
Enumerable.SequenceEqual( | ||
descriptorX.PropertyBag.OrderBy(propertyX => propertyX.Key, StringComparer.OrdinalIgnoreCase), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The PropertyBag
was constructed with a StringComparer.Ordinal
why would this differ?
⌚ |
🆙 📅 |
@@ -2,6 +2,7 @@ | |||
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. | |||
|
|||
using System; | |||
using System.Collections; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Prob don't need this anymore
aspnet/Mvc#1051