title: 'object' does not contain a definition for 'rxDetail'
body: <p><strong><em>Controller code</em></strong> </p>
  
  <pre><code>public ActionResult Index()
          {
              var data = (from pd in db.Prescription_Details join md in db.Medicine_Details 
                          on pd.Medicine_Id equals md.Medicine_Id 
                          select new MyPrescription {rxDetail=pd.Rx_Detail_Id , medicineName=md.Medicine_Name , dosageFrequency= pd.Dosage_Frequency}).ToList();  
  
              var prescs = db.Prescription_Details.Select(x =&gt; x.Prescription.Doctor_Details.Doctor_Name).Distinct().ToList();
              //entity
              ViewBag.prescriptions = prescs;
              ViewBag.dd = data;
              return View();
          }
  
  Razor code 
   @foreach (var item in ViewBag.dd)
                                          {
                                              &lt;tr&gt;
                                                  &lt;td&gt;@item.rxDetail&lt;/td&gt;
                                                  &lt;td&gt;@item.medicineName&lt;/td&gt;
                                                  &lt;td&gt;@item.dosageFrequency&lt;/td&gt;
                                              &lt;/tr&gt;
                                          }
  </code></pre>
  
  <p>Apart from making new class MyPrescriptions I am getting this error . Is there some other way to proceed with it ? </p>