FruityFoundation/Base/Structures/NullableExtensions.cs
2023-12-24 21:11:25 -05:00

11 lines
285 B
C#

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