예제 #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;
 }