This commit is contained in:
TheXamlGuy
2024-05-31 14:07:35 +01:00
parent 041dd81717
commit 8f1a3252c6
10 changed files with 112 additions and 41 deletions
-17
View File
@@ -1,17 +0,0 @@
using System.Reflection;
namespace Toolkit.Foundation;
public static class TypeExtensions
{
public static TAttribute? GetAttribute<TAttribute>(this Type type)
where TAttribute : Attribute
{
if (type.GetCustomAttribute<TAttribute>() is TAttribute attribute)
{
return attribute;
}
return null;
}
}