Given a definition like so
public class KeyValueItem<K,V>
{
public K Key { get; set; }
public V Value { get; set; }
public override string ToString()
{
return T.ToString(); // does not compile
}
}
How do i override ToString() and return V.ToString();
Well, it looks like you want to use:
Why?
Because you don’t have a T anywhere and K/V are types, not an instance of a type.