Hello,
I am creating a products controller following the example on MVC videos.
The List method is as follows:
public ActionResult List(int? page) {
dt.Products = (from p in db.Products
orderby p.UnitPrice
select p).ToPagedList(page ?? 0);
return View("List", viewData.ToList);
}In my case the products are classified using tags. Each product can have 0 to many tags, so Products table as a Many to Many relationship:
Products > ProductsTags > Tags
In my list I need to display all the tags associated to each post, separated by commas.
The same happens with the edit and update form.
My model is created by LinqToSQL.
I don't know exactly how to do this ... should I create a new type that encapsulates each product with its info and respective tags?
Anyway, any help would be great.
I was also looking at repositories but I am not sure if this helps me in this situation or if it is only a way to separate the model from the code in the controller.
Thank You,
Miguel