public async Task <IActionResult> Edit(int id, [Bind("ResearchAreaId,FieldName,AreaDescription")] Researcharea researcharea) { if (id != researcharea.ResearchAreaId) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(researcharea); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ResearchareaExists(researcharea.ResearchAreaId)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(researcharea)); }
public async Task <IActionResult> Create([Bind("ResearchAreaId,FieldName,AreaDescription")] Researcharea researcharea) { if (ModelState.IsValid) { _context.Add(researcharea); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(researcharea)); }