Esempio n. 1
0
        // GET: Artist/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Artist artist = db.Artist.Find(id);

            if (artist == null)
            {
                return(HttpNotFound());
            }


            //  var controllerB = new ControllerB();
            // controllerB.InitializeController(this.Request.RequestContext);


            var objController = new AlbumController();

            objController.InitializeController(this.Request.RequestContext);
            var albums = objController.listAlbums2(id);

            var response = new
            {
                artist = artist,
                albums = albums
            };

            return(Json(response, JsonRequestBehavior.AllowGet));
            // return PartialView(artist);
        }
Esempio n. 2
0
        public ActionResult listAlbums(int?id)
        {
            var objController = new ArtistController();

            objController.InitializeController(this.Request.RequestContext);
            var artist = objController.Details2(id);

            var objController2 = new AlbumController();

            objController2.InitializeController(this.Request.RequestContext);
            var albums = objController2.listAlbums(id);


            var model = new HomeView {
                ArtistSingle = artist, Album = albums
            };

            return(PartialView(model));
        }