How to create Extension Method TryGetValue(TKey, out TValue) of KeyValuePair<TKey, TValue>[] just like of Dictionary<TKey, TValue>
===

I have a `KeyValuePair<TKey, TValue>[]`. I want to create a `bool TryGetValue(TKey, out TValue)` extension method of it just like it is available in `Dictionary<TKey, TValue>`

I tried 

    public static bool TryGetValue<TKey, TValue>
    (this KeyValuePair<TKey, TValue>[] mapping, TKey key, out TValue value)
    {
        bool RetVal = false;

        KeyValuePair<TKey, TValue> kvp;

        kvp = mapping.First(x => x.Key.Equals(key));

        if(kvp.Key == null && kvp.Value == null)
        {
            RetVal = false;
            value = default(TValue);
        }
        else
        {
            RetVal = true;
            value = kvp.Value;
        }

        return Retval;
    }

Is this correct way? If not please suggest one.