Esempio n. 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;
        }
Esempio n. 2
0
 public ProductResult ProductView()
 {
     var product = new Product { Id = 1, Name = "Jamie" };
     return new ProductResult(product);
 }
Esempio n. 3
0
 public ProductResult(Product product)
 {
     _product = product;
 }