コード例 #1
0
        public ActionResult Create(int recordId, string songDescription, string songLyrics)
        {
            Dictionary <string, object> model = new Dictionary <string, object>();
            Record foundRecord = Record.Find(recordId);
            Song   newSong     = new Song(songDescription, songLyrics);

            foundRecord.AddSong(newSong);
            List <Song> recordSongs = foundRecord.Songs;

            model.Add("songs", recordSongs);
            model.Add("record", foundRecord);
            return(View("Show", model));
        }