示例#1
0
        public ActionResult Index()
        {
            var product = new Product { Id = 1, Name = "Jamie" };

            var view = View();
            view.ViewData.Add("id", product.Id);
            view.ViewData.Add("name", product.Name);

            return view;
        }
示例#2
0
 public ProductResult ProductView()
 {
     var product = new Product { Id = 1, Name = "Jamie" };
     return new ProductResult(product);
 }
示例#3
0
 public ProductResult(Product product)
 {
     _product = product;
 }