I want to convert a NameValueCollection to a KeyValuePair. Is there a way to do this easily for just a single value in a NameValueCollection?
I have this right now but it seems kind of verbose:
private KeyValuePair<string, string> GetEtagHeader(NameValueCollection collection)
{
var etagValue = collection.Get(HttpRequestHeader.IfMatch.ToString());
return new KeyValuePair<string, string>(HttpRequestHeader.IfMatch.ToString(), etagValue);
}