title: Inset an object inheriting from a database object does not work in EF
body: <p>I have this object:</p>
  
  <pre><code>public class OrderViewModel : ORDERS
      {
          public IEnumerable&lt;SelectListItem&gt; mCountryList { get; set; }
  
          public OrderViewModel()
          {
              List&lt;string&gt; listCountries = new List&lt;string&gt;();
              XmlDocument doc = new XmlDocument();
              doc.Load(HttpContext.Current.Server.MapPath("~/App_Data/countries.xml"));
  
              var xmlNodeList = doc.SelectNodes("//country");
  
              if (xmlNodeList != null)
              {
                  listCountries.AddRange(from XmlNode node in xmlNodeList select node.InnerText);
              }
  
              mCountryList = new SelectList(listCountries);
          }
  
          public void SetCountry(string _country)
          {
              foreach (var selectListItem in mCountryList.Where(_selectListItem =&gt; _selectListItem.Value == _country))
              {
                  selectListItem.Selected = true;
              }
          }
      }
  </code></pre>
  
  <p>Which inherits from <code>ORDERS</code>, an object contained in my database:</p>
  
  <pre><code>public DbSet&lt;ORDERS&gt; ORDERS { get; set; }
  </code></pre>
  
  <p>because I wanted to create a new <code>ORDERS</code> at this point, but needed the list of countries for user purpose. However when I try to create my order like this:</p>
  
  <pre><code>using (MyEntity db = new MyEntity())
  {
      if (db.Database.Connection.State == ConnectionState.Closed)
      {
          db.Database.Connection.Open();
      }
  
      OrderViewModel orderToReturn = new OrderViewModel();
  
      db.ORDERS.Add((ORDERS)orderToReturn);
  
      db.SaveChanges();
  }
  </code></pre>
  
  <p>I get the following error:</p>
  
  <pre><code>Mapping and metadata information could not be found for EntityType 'MyApp.ViewModels.OrderViewModel'.
  </code></pre>
  
  <p>What's happening? How can I correct this?</p>