title: How can I implement a dictionary whose value is also a key?
body: <p>Essentially, I want a data structure that resembles Dictionary, but having a difference that its values are also unique. In another words, it depicts a one to one relationship rather than one to many. </p>
  
  <p>An example should explain better. Suppose I call this new data structure MyMapping, and I want to save names of married couples in it:</p>
  
  <pre><code>        MyMapping&lt;string, string&gt; myMapping = new MyMapping&lt;string, string&gt;();
          myMapping.Add("Joe", "Ann");
          myMapping.Add("Ann", "Joe");// not allowed
          myMapping.Add("Joe", "Mary");// not allowed
          myMapping.Add("William", "Katie");// ok
          string partner = myMapping["Ann"];// result is Joe
          partner = myMapping["Joe"];//result is Ann
  </code></pre>