Пример #1
0
        //public ActionResult getMusic()
        //{
        //    CodeDB cc = new CodeDB();
        //    return View(cc.setDataInMusicDetailModel());
        //}

        public ActionResult getMusic()
        {
            CodeDB cc = new CodeDB();
            MvcMusicStoreEntities musicDB = new MvcMusicStoreEntities();
            dynamic model = new ExpandoObject();

            model.Genres = musicDB.Genres.ToList();
            model.Albums = musicDB.Albums.ToList();
            return(View(model));
        }
Пример #2
0
        // GET: Home

        public ActionResult Index()
        {
            CodeDB    cc           = new CodeDB();
            DataTable objDataTable = cc.getAllMusicTypes();

            ViewBag.getAllMusicTypes = objDataTable;
            return(View());

            //  return Content("This method returns plain texts.");

            //var employee = new
            //{
            //    Name = "Rajat Sharma",
            //    Age = "25",
            //    Occupation = "Software Developer"
            //};
            //return Json(employee, JsonRequestBehavior.AllowGet);

            //return File(Server.MapPath("~/App_Data/documentation.pdf"),
            //        contentType: "application/pdf",
            //        fileDownloadName: "documentation.pdf");
        }