public async Task<IActionResult> Create([Bind("ID,Title,MediaType,Format,Duration,Genre,Year,Rating,Location,Notes")] Media media) { if (ModelState.IsValid) { _context.Add(media); await _context.SaveChangesAsync(); return RedirectToAction(nameof(Index)); } return View(media); }
public async Task <IActionResult> Create([Bind("Format,LengthTime,Id,Name,Path,Width,Height")] Video video) { if (ModelState.IsValid) { _context.Add(video); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(video)); }