예제 #1
0
        public static TValue GetValueOrDefault <TKey1, TKey2, TKey3, TKey4, TKey5, TKey6, TKey7, TValue>(this IDictionary <KeyTuple <TKey1, TKey2, TKey3, TKey4, TKey5, TKey6, TKey7>, TValue> dictionary, TKey1 tKey1, TKey2 tKey2, TKey3 tKey3, TKey4 tKey4, TKey5 tKey5, TKey6 tKey6, TKey7 tKey7, TValue defaultValue = default(TValue))
        {
            TValue value;

            return(dictionary.TryGetValue(KeyTuple.Create(tKey1, tKey2, tKey3, tKey4, tKey5, tKey6, tKey7), out value)
                ? value
                : defaultValue);
        }
예제 #2
0
        public static TValue GetValueOrDefault <TKey1, TKey2, TValue>(this IDictionary <KeyTuple <TKey1, TKey2>, TValue> dictionary, TKey1 tKey1, TKey2 tKey2, TValue defaultValue = default(TValue))
        {
            TValue value;

            return(dictionary.TryGetValue(KeyTuple.Create(tKey1, tKey2), out value)
                ? value
                : defaultValue);
        }
예제 #3
0
 public static IEnumerable <TValue> Get <TKey1, TKey2, TKey3, TKey4, TKey5, TKey6, TKey7, TValue>(this ILookup <KeyTuple <TKey1, TKey2, TKey3, TKey4, TKey5, TKey6, TKey7>, TValue> lookup, TKey1 tKey1, TKey2 tKey2, TKey3 tKey3, TKey4 tKey4, TKey5 tKey5, TKey6 tKey6, TKey7 tKey7)
 {
     return(lookup[KeyTuple.Create(tKey1, tKey2, tKey3, tKey4, tKey5, tKey6, tKey7)]);
 }
예제 #4
0
 public static IEnumerable <TValue> Get <TKey1, TKey2, TKey3, TValue>(this ILookup <KeyTuple <TKey1, TKey2, TKey3>, TValue> lookup, TKey1 tKey1, TKey2 tKey2, TKey3 tKey3)
 {
     return(lookup[KeyTuple.Create(tKey1, tKey2, tKey3)]);
 }