title: Create generic property in interface
body: <p>I want to create an interface with a method GetId(). Depending on the subitems, it could either be an int, string or something else. This is why I tried with return type object (but then I can't specify the type in the subitems) and wanted to try with generics.</p>
  
  <p>How can I do this? </p>
  
  <p>What I already have:</p>
  
  <pre><code>public interface INode : IEquatable&lt;INode&gt;
  {
     object GetId();
  }
  
  public class PersonNode : INode
  {
     object GetId(); //can be int, string or something else
  }
  
  public class WorkItemNode : INode
  {
     int GetId(); //is always int
  }
  </code></pre>
  
  <p>Thank you!</p>