Ejemplo n.º 1
0
 public async Task <IActionResult> Create(IFormCollection collection, Subject subject)
 {
     try {
         if (ModelState.IsValid)
         {
             subjectRepo.Create(subject);
             await subjectRepo.SaveChangesAsync();
         }
         return(RedirectToAction(nameof(Index)));
     } catch {
         return(View());
     }
 }