namespace DigitalData.Core.Attributes { /// /// Provides helper methods for working with attributes. /// public static class AttrHelper { /// /// Retrieves the applied to a given type. /// /// The type to examine for the attribute. /// The found on the type; null if the attribute is not present. public static ADFilterAttribute? GetFilterAttrOf() { // Get the ADFilterAttribute from the type, if it exists Attribute? attr = Attribute.GetCustomAttribute(typeof(T), typeof(ADFilterAttribute)); // Check if the attribute is of the expected type and return it; otherwise, return null if (attr is ADFilterAttribute fAttr) return fAttr; return null; } } }