public async Task <IActionResult> Create([Bind("ImageId,Data")] Image image)
        {
            if (ModelState.IsValid)
            {
                _context.Add(image);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(image));
        }
        public async Task <IActionResult> Create([Bind("GenreId,GenreName")] Genre genre)
        {
            if (ModelState.IsValid)
            {
                _context.Add(genre);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(genre));
        }
Beispiel #3
0
        public async Task <IActionResult> Create([Bind("WorkId,ArtistId,WorkName")] Work work)
        {
            if (ModelState.IsValid)
            {
                _context.Add(work);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["ArtistId"] = new SelectList(_context.Artist, "ArtistId", "ArtistName", work.ArtistId);
            return(View(work));
        }
Beispiel #4
0
        public async Task <IActionResult> Create([Bind("ArtistId,GenreId,ArtistName")] Artist artist)
        {
            if (ModelState.IsValid)
            {
                _context.Add(artist);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["GenreId"] = new SelectList(_context.Genre, "GenreId", "GenreName", artist.GenreId);
            return(View(artist));
        }
Beispiel #5
0
        public async Task <IActionResult> Create([Bind("WorkVersionId,WorkId,WorkVersionName,Lossless")] WorkVersion workVersion)
        {
            if (ModelState.IsValid)
            {
                _context.Add(workVersion);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["WorkId"] = new SelectList(_context.Work, "WorkId", "WorkName", workVersion.WorkId);
            return(View(workVersion));
        }