wip
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user