Files
Toolkit2/Toolkit.Foundation/TypeExtensions.cs
T
Dan Clark aeff13a105 wip
2024-11-28 21:52:42 +00:00

10 lines
273 B
C#

namespace Toolkit.Foundation;
public static class TypeExtensions
{
public static Type MakeNullable(this Type type) =>
type.IsValueType && Nullable.GetUnderlyingType(type) == null
? typeof(Nullable<>).MakeGenericType(type)
: type;
}