public T GetValueOrDefault() => value ?? Default <T> .Get();
public static TSource ElementAtOrDefault_ <TSource>(this IEnumerable <TSource> source, int index, RequireClass <TSource> _ = default) where TSource : class { return(Enumerable.ElementAtOrDefault(source, index) ?? Default <TSource> .Get()); }
public static TSource FirstOrDefault_ <TSource>(this IEnumerable <TSource> source, RequireClass <TSource> _ = default) where TSource : class { return(Enumerable.FirstOrDefault(source) ?? Default <TSource> .Get()); }
public static TSource SingleOrDefault_ <TSource>(this IEnumerable <TSource> source, Func <TSource, bool> predicate, RequireClass <TSource> _ = default) where TSource : class { return(Enumerable.SingleOrDefault(source, predicate) ?? Default <TSource> .Get()); }