示例#1
0
 public static Option <T> TryAggregate <T>(this IEnumerable <T> self, Func <T, T, T> aggregator)
 {
     return(Option <T> .Try(() => self.Aggregate(aggregator)));
 }
示例#2
0
 public static Option <T> TryElementAt <T>(this IEnumerable <T> self, int index)
 {
     return(Option <T> .Try(() => self.ElementAt(index)));
 }
示例#3
0
 public static Option <T> TryLast <T>(this IEnumerable <T> self, Func <T, bool> predicate)
 {
     return(Option <T> .Try(() => self.Last(predicate)));
 }