@model IEnumerable<SportsStore.Domain.Entities.Product>.....this is my view List.cshtml
@{
ViewBag.Title = "Products";
}
@foreach (var j in Model) //getting error at Model
{
<div class="item">
<h3>@j.Name</h3>
@j.Description
<h4>@j.Price.ToString("C")</h4>
</div>
}
the sportstore example in pro Asp.Net MVC3 book chapter 7 before the part where i can prepare a database
this is my controller
public class ProductController : Controller
{
public ProductController()
{
}
//
// GET: /Product/
private IProductRepository repository;
public ProductController(IProductRepository productrepository)
{
repository=productrepository;
}
public ViewResult List()
{
return View();
}