public async Task <IActionResult> Edit(int id, [Bind("Id,ApplicationUserId,LifeConclusionHead,LifeConExpl,LifeConDate")] LifeConclusion lifeConclusion) { if (id != lifeConclusion.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(lifeConclusion); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!LifeConclusionExists(lifeConclusion.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["ApplicationUserId"] = new SelectList(_context.ApplicationUsers, "Id", "Id", lifeConclusion.ApplicationUserId); return(View(lifeConclusion)); }
public async Task <IActionResult> Create([Bind("Id,ApplicationUserId,LifeConclusionHead,LifeConExpl,LifeJoyExpl,LifeConDate")] LifeConclusion lifeConclusion) { if (ModelState.IsValid) { _context.Add(lifeConclusion); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["ApplicationUserId"] = new SelectList(_context.ApplicationUsers, "Id", "Id", lifeConclusion.ApplicationUserId); return(View(lifeConclusion)); }