public IActionResult GuitarCase()
        {
            var model = new GuitarCaseModel();

            model.Cables = new List <GuitarCable> {
                new GuitarCable {
                    Brand = "ACME", Length = 12
                }
            };
            model.MyGuitar = new Guitar {
                BodyStyle = "Strat", Brand = "Fendor", Finish = "White"
            };
            return(View(model));
        }
Exemple #2
0
        // Listing 1-8
        public IActionResult GuitarCase()
        {
            ViewBag.Message = "Whats in my case.";
            var model = new GuitarCaseModel();

            model.Cables = new List <GuitarCable> {
                new GuitarCable {
                    Brand = "Fendor", Gage = 11
                }
            };
            model.MyGuitar = new Guitar {
                BodyStyle = "Strat", Brand = "Fender", Finish = "Fire"
            };

            return(View(model));
        }