title: Can I create a generic method that accepts two different types in C#
body: <p>Can I create a generic method that accept two types. The <code>attributeType</code> and  <code>ts_attributeType</code> do not share any common parent class although they do have the same fields.</p>
  
  <p>Is this possible? Or is there some way I can achieve this?</p>
  
  <pre><code>private static void FieldWriter&lt;T&gt;(T row)
          where T : attributeType, ts_attributeType
  
      {
          Console.Write(((T)row).id + "/" + (((T)row).type ?? "NULL") + "/");
      }
  </code></pre>
  
  <p>I have seen this <a href="https://stackoverflow.com/questions/3717049/c-generics-possible-to-create-a-method-with-n-generic-types/3717065#3717065">answer from Jon Skeet</a>, however I am not certain if it also applies to my question. </p>
  
  <p>Some further background:
  Both <code>attributeType</code> and <code>ts_attributeType</code> have been created using the xsd.exe tool; and are are partial classes. </p>