FruityFoundation/Base/Extensions/NullableExtensions.cs
Kyle Ratti 18d2e1616b
v1.0
2022-02-13 11:59:47 -05:00

12 lines
324 B
C#

using CommonCore.Base.Structures;
namespace CommonCore.Base.Extensions;
public static class NullableExtensions
{
public static Maybe<T> ToMaybe<T>(this T? item) where T : struct =>
item ?? Maybe<T>.Empty();
public static Maybe<T> ToMaybe<T>(this T? item) where T : class =>
item ?? Maybe<T>.Empty();
}