title: Pass more than one model to view
body: <pre><code>public ActionResult Index()
  { 
      var pr = db.products;
      return View(pr); 
  }
  </code></pre>
  
  <p>Firstly - I want to pass to the view more data - something like:</p>
  
  <pre><code>public ActionResult Index()
  { 
      var pr = db.products;
      var lr = db.linksforproducts(2)
      return View(pr,lr); 
  }
  </code></pre>
  
  <p>How do I read the <code>lr</code> data in the view?</p>
  
  <p>Secondly - on the view I have a table of products, and I want to add to the table a column with all the tags of this products. How do I get the tags for every product?</p>
  
  <p>now i create this code</p>
  
  <pre><code>public class catnewModel
  {
  
      public IQueryable&lt;category&gt; dl { get; set;   }
      public IQueryable&lt;product&gt; dr { get; set;   }
  }
  </code></pre>
  
  <p>and my controller</p>
  
  <pre><code>public ActionResult Index()
      {
  
          var pr = db.products;
          var pl = db.categories;
  
          catnewModel model = new catnewModel();
          model.dr = pr;
          model.dl = pl;
  
          return View(model);
      }
  </code></pre>
  
  <p>in my view i try to iterate over</p>
  
  <pre><code> &lt;% foreach (var item in Model.dr)  %&gt;
  </code></pre>
  
  <p>but i get error on </p>
  
  <pre><code>error CS1061: 'System.Collections.Generic.IEnumerable&lt;amief.Models.catnewModel&gt;' does not contain a definition for 'dr' and no extension method 
  </code></pre>