Esempio n. 1
0
        public async Task <IActionResult> Create([Bind("ID,Artist,Title,Bpm,Key,Intensity,Year,Disc,Track,Genre")] Song song)
        {
            if (ModelState.IsValid)
            {
                _context.Add(song);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(song));
        }
        public async Task <IActionResult> Create([Bind("ID,SongID,Created")] History history)
        {
            if (ModelState.IsValid)
            {
                _context.Add(history);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["SongID"] = new SelectList(_context.Songs, "ID", "ID", history.SongID);
            return(View(history));
        }