|
Association
The Association class
public class Association<TKey, TValue>
{
// Methods
public Association(TKey key, TValue value);
public KeyValuePair<TKey, TValue> ToKeyValuePair();
// Properties
public TKey Key { get; set; }
public TValue Value { get; set; }
}A class cloning the functionality of the standard KeyValuePair<TKey, TValue>, but with added setters on the Key and Value properties. Another benefit of this structure over the KeyValuePair is that it can XMLSerialized, and hence all the structures built on it. Also this one is implemented as a class, whereas KeyValuePair is a structure. | |
► Sign in to add a comment