public async Task <IActionResult> Edit(Guid id, [Bind("ID,Answer,CreatedDate,Enabled,LastModifiedDate")] ReferenceRequestQuestionAnswer referenceRequestQuestionAnswer) { if (id != referenceRequestQuestionAnswer.ID) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(referenceRequestQuestionAnswer); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ReferenceRequestQuestionAnswerExists(referenceRequestQuestionAnswer.ID)) { return(NotFound()); } else { throw; } } return(RedirectToAction("Index")); } return(View(referenceRequestQuestionAnswer)); }
public async Task <IActionResult> Create([Bind("ID,Answer,CreatedDate,Enabled,LastModifiedDate")] ReferenceRequestQuestionAnswer referenceRequestQuestionAnswer) { if (ModelState.IsValid) { referenceRequestQuestionAnswer.ID = Guid.NewGuid(); _context.Add(referenceRequestQuestionAnswer); await _context.SaveChangesAsync(); return(RedirectToAction("Index")); } return(View(referenceRequestQuestionAnswer)); }