@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>
}
pro Asp.Net MVC3 书籍第 7 章中的 Sportstore 示例,在我可以准备数据库的部分之前
这是我的控制器
public class ProductController : Controller
{
public ProductController()
{
}
//
// GET: /Product/
private IProductRepository repository;
public ProductController(IProductRepository productrepository)
{
repository=productrepository;
}
public ViewResult List()
{
return View();
}