private static bool Equals(NullableOf <T> left, NullableOf <T> right) { return (left.HasValue != right.HasValue ? false : !left.HasValue ? true : EqualityComparer <T> .Default.Equals(left.value, right.value)); }
public static Nullable <TResult> SelectMany <T, TMid, TResult>(this NullableOf <T> @this, Func <T, Nullable <TMid> > midSelector, Func <T, TMid, TResult> resultSelector, RequireStruct <TResult> _ = default(RequireStruct <TResult>)) where T : class where TMid : struct where TResult : struct { if ([email protected]) { return(default(Nullable <TResult>)); } var mid = midSelector((T)@this); if (!mid.HasValue) { return(default(Nullable <TResult>)); } return(resultSelector((T)@this, (TMid)mid)); }
public bool Equals(NullableOf <T> that) { return(Equals(this, that)); }
public static Nullable <TResult> Select <T, TResult>(this NullableOf <T> @this, Func <T, TResult> func, RequireStruct <TResult> _ = default(RequireStruct <TResult>)) where T : class where TResult : struct { return(@this.HasValue ? func((T)@this) : default(Nullable <TResult>)); }