title: How Can I Add A Derived Class To Repository
body: <p>I need an advice.
  I have two class and one ofe them a derived class.
  <strong>I want to insert my base and derived class in a one method</strong>. How can i accomplish this?</p>
  <pre><code>//my entities
  public class Form
  {
      public int FormId { get; set; }
      public string Name { get; set; }
      public string Surname { get; set; }
      public string Message { get; set; }
  }
  
  public class ReturnForm : Form
  {
      public int OrderId { get; set; }
  }
  
  //my repository
  public class FormRepository : IFormRepository:IDisposable
  {
      private readonly MyContext _db;
  
      public FormRepository(MyContext db)
      {
          _db = db;
      }
      
      //I want to insert here Form or ReturnForm objects.
      //What can i do?
      public void AddFormMessage(Form form)
      {
          _db.Forms.Add(form);
      }
  }
  </code></pre>