title: Entity Framework and abstract class
body: <p>I'm new to Entity Framework and would like to know if, what I want to do, is possible.</p>
  
  <p>I have a class named '<strong>Monitor</strong>' which contains a List of '<strong>MonitorField</strong>'.</p>
  
  <p>Each '<strong>MonitorField</strong>' have a List of an abstract class called 'AMonitoringTool'**</p>
  
  <p><strong>AMonitoringTool</strong> is provide to allow another developer to create his own kind of field, by inheriting from <strong>AMonitoringTool</strong> in an external DLL.</p>
  
  <p>The main issue is that the application do not know the real type in '<strong>MonitorField</strong>', preventing from saving my objects in database.</p>
  
  <p>I have a <strong>MonitorEntity</strong> with a <strong>DbSet</strong>, but I can't save my Monitor list, I get this error message : </p>
  
  <p>"The abstract type '{...}.<strong>AMonitoringTool</strong>' has no mapped descendant and so cannot be mapped..."</p>
  
  <p>My first thought was to implement the mapping in every DLL that inherit from '<strong>AMonitoringTool</strong>', but I don't how to do it.</p>
  
  <p><strong>MonitorEntity.cs</strong></p>
  
  <pre><code>public class MonitorEntity : DbContext
  {
      public DbSet&lt;Monitor&gt; Monitors { get; set; }
  
      public MonitorEntity()
      {
  
      }
  }
  </code></pre>
  
  <p><strong>Monitor.cs</strong></p>
  
  <pre><code>   public class Monitor
      {
          public Monitor(string name)
          {
              MonitorName = name;
              FieldList = new List&lt;MonitorField&gt;();
          }
  
          private List&lt;MonitorField&gt; m_fieldList = null;
          public virtual List&lt;MonitorField&gt; FieldList
          {
              get
              {
                  return m_fieldList;
              }
              set
              {
                  m_fieldList = value;
              }
          }
      }
  </code></pre>
  
  <p><strong>MonitorField.cs</strong></p>
  
  <pre><code>public class MonitorField
  {
      public AMonitoringTool Configuration { get; set; }
  
      public MonitorField()
      {
          FieldName = "&lt;label&gt;";
      }
  }
  </code></pre>