Skip to content

Commit 8327f67

Browse files
committed
Fix ExtractAttributes() logic
1 parent 85eca1f commit 8327f67

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

Orm/Xtensive.Orm/Reflection/AttributeHelper.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,9 +97,10 @@ private static IEnumerable<Attribute> ExtractAttributes((MemberInfo member, Type
9797
attributes = poe.GetAttributes(attributeType).ToList();
9898
}
9999
if ((options & AttributeSearchOptions.InheritFromBase) != 0
100-
&& (options & AttributeSearchOptions.InheritFromAllBase) == 0
100+
&& (options & AttributeSearchOptions.InheritRecursively) == 0
101101
&& member.GetBaseMember() is MemberInfo bm) {
102102
attributes.AddRange(GetAttributes(bm, attributeType, options));
103+
return attributes;
103104
}
104105
}
105106

Orm/Xtensive.Orm/Reflection/AttributeSearchOptions.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,13 @@ public enum AttributeSearchOptions
2929
/// </summary>
3030
InheritFromBase = 1,
3131
/// <summary>
32+
/// Attributes inherit recursively.
33+
/// </summary>
34+
InheritRecursively = 2,
35+
/// <summary>
3236
/// Attributes from all the bases should be inherited.
3337
/// </summary>
34-
InheritFromAllBase = 2,
38+
InheritFromAllBase = InheritFromBase | InheritRecursively,
3539
/// <summary>
3640
/// If no attributes are found on the specified method,
3741
/// attributes from the property or event it belongs to should be inherited.

0 commit comments

Comments
 (0)