public async Task <IActionResult> Edit(int id, [Bind("SelectionСommitteeId,Name,Year,DateStart,DateEnd")] SelectionСommittee selectionСommittee) { if (id != selectionСommittee.SelectionСommitteeId) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(selectionСommittee); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!SelectionСommitteeExists(selectionСommittee.SelectionСommitteeId)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(selectionСommittee)); }
public async Task <IActionResult> Create([Bind("SelectionСommitteeId,Name,Year,DateStart,DateEnd")] SelectionСommittee selectionСommittee) { if (ModelState.IsValid) { _context.Add(selectionСommittee); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(selectionСommittee)); }