using System.Reflection; namespace NftFaucet.Extensions; public static class TypeExtensions { public static TAttribute GetAttribute(this MemberInfo memberInfo) where TAttribute : Attribute { var customAttributes = memberInfo?.GetCustomAttributes(false); var attribute = customAttributes?.OfType().SingleOrDefault(); return attribute; } }