Class MaybeValueTypeExtensions
- Namespace
- Existential
- Assembly
- Existential.Net.dll
Provides extension methods for converting Maybe<T>, to System.Nullable<T> where T is a value type.
public static class MaybeValueTypeExtensions
- Inheritance
-
System.ObjectMaybeValueTypeExtensions
- Inherited Members
-
System.Object.Equals(System.Object)System.Object.Equals(System.Object, System.Object)System.Object.GetHashCode()System.Object.GetType()System.Object.MemberwiseClone()System.Object.ReferenceEquals(System.Object, System.Object)System.Object.ToString()
Methods
ToCollectionOfNullable<T>(IEnumerable<Maybe<T>>)
Converts a collection of Maybe<T> to a collection of System.Nullable<T> of the same values.
public static IEnumerable<T?> ToCollectionOfNullable<T>(this IEnumerable<Maybe<T>> inCollection)
where T : struct
Parameters
inCollection
System.Collections.Generic.IEnumerable<Maybe<T>>The collection containing the values to be converted from Maybe<T> to System.Nullable<T>.
Returns
- System.Collections.Generic.IEnumerable<System.Nullable<T>>
A collection of System.Nullable<T> with the values of the Maybe<T>s in the original collection
inCollection
.
Type Parameters
T
The type of the Maybe<T>s to be converted to a System.Nullable<T>.
ToNullable<T>(Maybe<T>)
Returns the value of a Maybe<T> as System.Nullable<T>.
public static T? ToNullable<T>(this Maybe<T> inMaybe)
where T : struct
Parameters
Returns
- System.Nullable<T>
A System.Nullable<T> containing the value of the Maybe<T>
inMaybe
.
Type Parameters
T
The type of the Maybe<T> to be converted to a System.Nullable<T>.