Ejemplo n.º 1
0
        public static Maybe <T> TryGet <T>(this ITryGet <int, T> self, int key)
        {
            T value = self.TryGet(key, out bool fail);

            return(fail ? default(Maybe <T>) : new Maybe <T>(value));
        }
Ejemplo n.º 2
0
        public static V TryGet <K, V>(this ITryGet <K, V> self, K key, V defaultValue)
        {
            V value = self.TryGet(key, out bool fail);

            return(fail ? defaultValue : value);
        }
Ejemplo n.º 3
0
        public static Maybe <V> TryGet <K, V>(this ITryGet <K, V> self, K key)
        {
            V value = self.TryGet(key, out bool fail);

            return(fail ? default(Maybe <V>) : new Maybe <V>(value));
        }