Skip to content

Commit 3935ed2

Browse files
committed
fix
1 parent 6bab05c commit 3935ed2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/PublicApiGenerator/ApiGenerator.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -693,7 +693,7 @@ static void AddPropertyToTypeDeclaration(CodeTypeDeclaration typeDeclaration, IM
693693
var defaultMemberAttributeValue = typeDeclarationInfo.CustomAttributes.SingleOrDefault(x =>
694694
x.AttributeType.FullName == "System.Reflection.DefaultMemberAttribute")
695695
?.ConstructorArguments.Select(x => x.Value).OfType<string>().SingleOrDefault();
696-
if (!string.IsNullOrEmpty(defaultMemberAttributeValue) && member.Name != "Item")
696+
if (!string.IsNullOrEmpty(defaultMemberAttributeValue) && member.Name == defaultMemberAttributeValue && member.Name != "Item")
697697
{
698698
property.Name = "Item";
699699
property.CustomAttributes.Add(

0 commit comments

Comments
 (0)