title: Override Dictionary<Datetime,int> 's ContainsKey
body: <p>I have a <code>Dictionary&lt;DateTime, int&gt;</code> defined like this:</p>
  
  <pre><code>public Dictionary&lt;DateTime, int&gt; Days;
  </code></pre>
  
  <p>Each <code>DateTime</code> is associated to an <code>int</code>. I'd like to have a function which indicates if there is already a <code>DateTime</code> with the same day in my dictionary:</p>
  
  <pre><code>public int GetIntFromDate(DateTime date)
  {
      int i = -1;
      if (Days.ContainsKey(date))
      {
          i= CorrespondanceJoursMatchs[date];
      }
  
      return i;
  }
  </code></pre>
  
  <p>This is perfect but I'd like that the <code>ContainsKey</code> returns <code>true</code> if there is already a <code>DateTime</code> with the same Day+Month+Year (without looking at hours/minutes/seconds).</p>
  
  <p>In fact my dictionary shouldn't allow 2 <code>DateTime</code> index with the same Day/Month/Year.</p>
  
  <p>A solution could be to create a class with only a <code>DateTime</code> attribute and override <code>GetHashCode</code> and <code>Equals</code>, but maybe there's a better solution?</p>