public ActionResult Index()
{
var pr = db.products;
return View(pr);
}
Firstly - I want to move on to presenting more data - something like:
public ActionResult Index()
{
var pr = db.products;
var lr = db.linksforproducts(2)
return View(pr,lr);
}
How to read data lrin a view?
Secondly - in the view, I have a product table, and I want to add a column to the table with all the tags for these products. How to get tags for each product?
now i am creating this code
public class catnewModel
{
public IQueryable<category> dl { get; set; }
public IQueryable<product> dr { get; set; }
}
and my controller
public ActionResult Index()
{
var pr = db.products;
var pl = db.categories;
catnewModel model = new catnewModel();
model.dr = pr;
model.dl = pl;
return View(model);
}
in my opinion I'm trying to iterate
<% foreach (var item in Model.dr) %>
but i get an error on
error CS1061: 'System.Collections.Generic.IEnumerable<amief.Models.catnewModel>' does not contain a definition for 'dr' and no extension method
source
share