Esempio n. 1
0
 public static Result <T> Take <T>(this ITypedArgumentPack pack)
 {
     if (pack.Take(out T value))
     {
         return(value);
     }
     return(new ArgumentMissingException(typeof(T)));
 }
Esempio n. 2
0
 public static T TakeRequired <T>(this ITypedArgumentPack pack, string noun)
 {
     if (pack.Take(out T value))
     {
         return(value);
     }
     throw new ArgumentMissingException(noun);
 }