Sorry if my question is poorly worded, but it is precisely because I don't know how to word the question that I can't easily search this on google.
Basically I just want to combine these two functions but couldn't find a generic example with a generic inside the of a parameter? What do I call the bracketed area of a parameter? is type specifier a real term?
anyway I want to combine them into one function that takes two keyvaluepair<int, T>
but I can't seem to get the syntax right.
public class BinarySearchComparers:IComparer<KeyValuePair<int, string>>, IComparer<KeyValuePair<int, byte>>
{
public int Compare(KeyValuePair<int, string> x, KeyValuePair<int, string> y)
{
return x.Key.CompareTo(y.Key);
}
public int Compare(KeyValuePair<int, byte> x, KeyValuePair<int, byte> y)
{
return x.Key.CompareTo(y.Key);
}
}