public async Task <IActionResult> Edit(int id, [Bind("Id,Title,Content,Text")] HomeSpecialitySucces homeSuccess) { if (id != homeSuccess.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(homeSuccess); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!HomeSuccessExists(homeSuccess.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(homeSuccess)); }
public async Task <IActionResult> Create([Bind("Id,Title,Content,Text")] HomeSpecialitySucces homeSuccess) { if (ModelState.IsValid) { _context.Add(homeSuccess); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(homeSuccess)); }