public ProductsListViewModel GetProduct(string city, string name, IProductRepository repo) { var model = new ProductsListViewModel { Products = from p in repo.Products where (p.Name == name && p.City == city) select p }; return model; }
public ViewResult List(string city, string name) { name = name.Replace("—", " "); var model = new ProductsListViewModel { Products = from p in _repository.Products where (p.Name == name && p.City == city) select p }; return View(model); }
public ActionResult DataCompleted(ProductsListViewModel model) { //return View((object)model); TempData["Model"] = model; return RedirectToAction("ListAreas", "Product", new { area = "" }); }