public async Task <IActionResult> Create([Bind("DanceVideoId,Title,VideoUrl,Description")] DanceVideo danceVideo)
        {
            if (ModelState.IsValid)
            {
                _context.Add(danceVideo);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(danceVideo));
        }
        public async Task <IActionResult> Create([Bind("DanceId,Name,Speed")] Dance dance)
        {
            if (ModelState.IsValid)
            {
                _context.Add(dance);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(dance));
        }
        public async Task <IActionResult> Create([Bind("SyllabusId,Level,DanceId")] Syllabus syllabus)
        {
            if (ModelState.IsValid)
            {
                _context.Add(syllabus);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["DanceId"] = new SelectList(_context.Dance, "DanceId", "DanceId", syllabus.DanceId);
            return(View(syllabus));
        }
Пример #4
0
        public async Task <IActionResult> Create([Bind("DanceMoveId,Name,DanceVideoId,SyllabusId")] DanceMove danceMove)
        {
            if (ModelState.IsValid)
            {
                _context.Add(danceMove);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["SyllabusId"]   = new SelectList(_context.Syllabus, "SyllabusId", "SyllabusId", danceMove.SyllabusId);
            ViewData["DanceVideoId"] = new SelectList(_context.DanceVideo, "DanceVideoId", "DanceVideoId", danceMove.DanceVideoId);
            return(View(danceMove));
        }