title: Same KnownType Attribute For Multiple Abstract Classes
body: <p>I'd like to know if I can add the same class as a knowntype to multiple abstract classes.</p>
  
  <p>My problem at the moment is that I have two abstract classes in the same namespace:</p>
  
  <p>Let's call this namespace "Thing"</p>
  
  <p>I have two abstract classes in Thing, Fruit and Vegetable.</p>
  
  <p>Both of these abstract classes are inherited by the two different classes in the same namespace, but have the same name. "Tomato"</p>
  
  <p>So I have two declarations:</p>
  
  <pre><code>namespace Thing
  
  [KnownType(typeof(Tomato))]
  public abstract class Fruit {}
  
  public sealed class Tomato: Fruit{}
  </code></pre>
  
  <p>as well as</p>
  
  <pre><code>namespace Thing
  
  [KnownType(typeof(Tomato))]
  public abstract class Vegetable {}
  
  public sealed class Tomato: Vegetable{}
  </code></pre>
  
  <p>Type 'Thing.Tomato' cannot be added to list of known types since another type 'Thing.Tomato' with the same data contract name "{datacontractname: Tomato}" is already present.</p>
  
  <p>I've refactored the two declarations of Tomato into it's own file and now one single declaration.  Now everything will serialize, but when I look at the custom attributes for both abstract classes only one of them will get the knowntype attribute.  That class will also be the only one that knows that it has a subclass of Tomato.</p>
  
  <p>Edit: I was a bit too hasty with my refactor as I need Tomato to have multiple inheritance.  At the moment I've changed namespace Thing to Thing.Fruit and Thing.Vegetable, keeping the multiple declarations.  The duplication of code makes me dubious that this is a good solution though.</p>