示例#1
0
 public static TResult NullCond <TArg, TResult>(this FluentApiUtilitiesHandle <TArg> hnd, Func <TArg, TResult> func)
 {
     if (func is null)
     {
         throw new ArgumentNullException(paramName: nameof(func));
     }
     //
     if (hnd.Value == null)
     {
         return(default);
示例#2
0
 public static void NullCond <TArg>(this FluentApiUtilitiesHandle <TArg> hnd, Action <TArg> action)
 {
     if (action is null)
     {
         throw new ArgumentNullException(paramName: nameof(action));
     }
     //
     if (hnd.Value != null)
     {
         action(obj: hnd.Value);
     }
 }
示例#3
0
 public static FluentApiUtilitiesHandle <TResult> Select <TSource, TResult>(this FluentApiUtilitiesHandle <TSource> hnd, Func <TSource, TResult> selector)
 {
     selector.EnsureNotNull(nameof(selector));
     //
     return(new FluentApiUtilitiesHandle <TResult>(value: selector(arg: hnd.Value)));
 }