title: error 1061. T doesn't contain a definition for <propertyName>
body: <p>i am having around 7 models who have same properties(atributes). On view page i am using a model(name = commonModel) which contains all those properties and a extra property to choose in which model's database i want to save that sent data so i created a valuesRelocate Method that will assign all the properties of commonModel to the choosen model (in this case article).
  The code i gave below is working but i am getting a error when assigning value of a  property of commonModel to a property of article.
  What is  the better way to do this.
  Error is at tempModel.question</p>
  
  <pre><code>    public ActionResult Create([Bind(Include = 
     "Id,question,ans,ruleApplicable,hint,exception,modelSelector")] 
     commonModel commonModel)
      {
          if (ModelState.IsValid)
          {
  
              if (commonModel.modelSelector == "article")
              {
                  article model2 = new article();
                  article model1 = valuesRelocate&lt;article&gt;(commonModel, 
     model2);
                  db.articleDb.Add(model1);
                  db.SaveChanges();
                  return RedirectToAction("Index");
              }
          }
  
              return View(commonModel);
      }
  
      private T valuesRelocate&lt;T&gt;(commonModel commonModel, T tempModel)   {
  
          tempModel.question = commonModel.question;
          return tempModel;
      } 
  </code></pre>
  
  <p>I am using a abstract base class named baseGrammar .code for both the class is shown below</p>
  
  <pre><code> public abstract class baseGrammar
  {
      [Key]
      public int Id { get; set; }
      [Required]
      public string question { get; set; }
      [Required]
      public string ans { get; set; }
      public string ruleApplicable { get; set; }
      public string hint { get; set; }
      public bool exception { get; set; }
  }
  </code></pre>
  
  <p>the one shown above is base class
  and those shown below are derived classes
  i use different classes because i wanted to have different classes for different grammatical concepts.</p>
  
  <pre><code>public class article : baseGrammar
  {
  
  }
  
   public class commonModel : baseGrammar
  {
      [Required]
      public string modelSelector { get; set; }
  }
  </code></pre>
  
  <p>hope this helps.</p>