title: Create method with access to similar named field, but different types of object without inheritance
body: <p>Create method with access to similar named field, but different types of object without inheritance in c#.</p>
  
  <p>For ex. I have 2 Classes:</p>
  
  <pre><code>      public class MyClass1
        {
            public int Id { get; set; }
        }
        public class MyClass2
        {
            public int Id { get; set; }
        }
  </code></pre>
  
  <p>And I need to create method and pass to it instance of each Classes:</p>
  
  <pre><code>    DoStuff(new MyClass1());
      DoStuff(new MyClass2());
  </code></pre>
  
  <p>And Method will be like this:</p>
  
  <pre><code>    private void DoStuff&lt;T&gt;(T obj)
      {
          int i = obj.Id(); // here is the problem
      }
  </code></pre>
  
  <p>Yes, problem is, that <code>obj</code> can't resolve <code>Id</code>. Solution simple - create <code>RootClass</code> with <code>Id</code> property, and use <code>public class MyClass1: RootClass</code>... , but I can't do this.</p>
  
  <p>Question is: Can I use line like   <code>int i = obj.Id();</code> without creating <code>RootClass</code>?</p>
  
  <p><strong>Edit:</strong> I need answers like: <br> No, because.... or <br> Yes, do this.....</p>