title: Is there a way to automatically generate equals and hashcode method in Visual Studio
body: <p>In Java when you want to have remove correctly object from a generic <code>Collection</code> by <code>remove()</code> method you have to implement <code>equals(Object o)</code> and <code>remove()</code> method which can be automatically generated in Eclipse. Example of that method looks like that ---> below.</p>
  
  <ol>
  <li><p>How to automatically generate that method in C# (Visual Studio, I'm on VS2013)?</p></li>
  <li><p>Maybe it is not necessary to make <code>List.Remove()</code> method working properly? </p></li>
  <li><p>IF it is not possible automatically how the reference <code>Equals</code> methods should look like? I mean how it should look like.</p></li>
  <li><p>Is <code>Equals()</code> method is even used in <code>List.Remove()</code> if so could you show me how the <code>Equals()</code> should be implemented to return true if we compare THE SAME OBJECTS (same address in memory)</p></li>
  </ol>
  
  <hr>
  
  <pre><code>  @Override
          public int hashCode() {
              final int prime = 31;
              int result = 1;
              result = prime * result + ((centerPanel == null) ? 0 :          centerPanel.hashCode());
          result = prime * result + ((lowerPanel == null) ? 0 : lowerPanel.hashCode());
          return result;
      }
  
      @Override
      public boolean equals(Object obj) {
          if(this == obj)
              return true;
          if(obj == null)
              return false;
          if(getClass() != obj.getClass())
              return false;
          LayoutDemo other = (LayoutDemo) obj;
          if(centerPanel == null) {
              if(other.centerPanel != null)
                  return false;
          } else if(!centerPanel.equals(other.centerPanel))
              return false;
          if(lowerPanel == null) {
              if(other.lowerPanel != null)
                  return false;
          } else if(!lowerPanel.equals(other.lowerPanel))
              return false;
          return true;
      }
  </code></pre>