From 6088eac0533e99ea51c11b88696cf4275d731e64 Mon Sep 17 00:00:00 2001 From: Sergei Pavlov Date: Wed, 16 Apr 2025 15:26:37 -0700 Subject: [PATCH 1/2] Make `.GetAttributes()` internal --- Orm/Xtensive.Orm/Reflection/AttributeHelper.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Orm/Xtensive.Orm/Reflection/AttributeHelper.cs b/Orm/Xtensive.Orm/Reflection/AttributeHelper.cs index 647ca4951e..3a583bed80 100644 --- a/Orm/Xtensive.Orm/Reflection/AttributeHelper.cs +++ b/Orm/Xtensive.Orm/Reflection/AttributeHelper.cs @@ -68,7 +68,7 @@ private static void AddAttributesFromBase(ref TAttribute[] attributes, MemberInf } } - public static TAttribute[] Get(MemberInfo member, AttributeSearchOptions options) => + internal static TAttribute[] Get(MemberInfo member, AttributeSearchOptions options) => Dictionary.GetOrAdd(new PerAttributeKey(member.MetadataToken, member.Module.ModuleHandle, options), ExtractAttributesByKey, member); } @@ -79,7 +79,7 @@ public static TAttribute[] Get(MemberInfo member, AttributeSearchOptions options /// Member to get attributes of. /// Attribute search options. /// An array of attributes of specified type. - public static IReadOnlyList GetAttributes(this MemberInfo member, AttributeSearchOptions options = AttributeSearchOptions.InheritNone) + internal static IReadOnlyList GetAttributes(this MemberInfo member, AttributeSearchOptions options = AttributeSearchOptions.InheritNone) where TAttribute : Attribute => AttributeDictionary.Get(member, options); /// From 8b4a9572e0c6c88dd304033f4fba595818f21061 Mon Sep 17 00:00:00 2001 From: Sergei Pavlov Date: Wed, 16 Apr 2025 15:46:00 -0700 Subject: [PATCH 2/2] .GetAttribute() --- Orm/Xtensive.Orm/Reflection/AttributeHelper.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Orm/Xtensive.Orm/Reflection/AttributeHelper.cs b/Orm/Xtensive.Orm/Reflection/AttributeHelper.cs index 3a583bed80..e886094f79 100644 --- a/Orm/Xtensive.Orm/Reflection/AttributeHelper.cs +++ b/Orm/Xtensive.Orm/Reflection/AttributeHelper.cs @@ -94,7 +94,7 @@ internal static IReadOnlyList GetAttributes(this MemberI /// throws , if there is more then one attribute of specified type found. /// /// Thrown if there is more then one attribute of specified type found. - public static TAttribute GetAttribute(this MemberInfo member, AttributeSearchOptions options = AttributeSearchOptions.InheritNone) + internal static TAttribute GetAttribute(this MemberInfo member, AttributeSearchOptions options = AttributeSearchOptions.InheritNone) where TAttribute : Attribute { var attributes = AttributeDictionary.Get(member, options);