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