Exemple #1
0
 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);
 }
Exemple #2
0
        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));
        }