My favorites | Sign in
Project Home Downloads Wiki Issues Source
Search
for

Contents

Complete wiki list

Association  
The Association class
Updated Aug 12, 2009 by hus...@gmail.com
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
Powered by Google Project Hosting