title: Adding a method to class that inherits from an Interface
body: <p>This is .NET 4.0/C#. I have a class that inherits from an interface:</p>
  
  <pre><code>public class DocumentModel : IDocumentObject
  {
       //this is not in the interface and wont ever be
       public void NewMethod(){//my code}
  }
  </code></pre>
  
  <p>In my <code>DocumentModel</code> class, I added a public method that is not a part of the interface. When I call it, </p>
  
  <pre><code>var doc = new DocumentModel();
  doc.NewMethod();
  </code></pre>
  
  <p>I get the following:</p>
  
  <blockquote>
    <p>Error 30 'IDocumentObject' does not contain a definition for 'NewMethod' and no<br>
    extension method 'NewMethod' accepting a first argument of type 'IDocumentObject'</p>
  </blockquote>
  
  <p>How do I add a method to my class that's not in the interface? Thanks</p>