using System.Reflection; namespace Toolkit.Foundation; public static class TypeExtensions { public static TAttribute? GetAttribute(this Type type) where TAttribute : Attribute { if (type.GetCustomAttribute() is TAttribute attribute) { return attribute; } return null; } }