public ActionResult Edit(DrivePhrase model) { try { // TODO: Add update logic here if (!ModelState.IsValid) { return(View(model)); } var DrivePhrase = _mapper.Map <DrivePhrase>(model); var isSuccess = _repo.Update(DrivePhrase); if (!isSuccess) { ModelState.AddModelError("", "Something Went Wrong!"); return(View(model)); } return(RedirectToAction(nameof(Index))); } catch { ModelState.AddModelError("", "Something Went Wrong!"); return(View(model)); } }
public bool Update(DrivePhrase entity) { _db.DrivePhrases.Update(entity); return(Save()); }
public bool Delete(DrivePhrase entity) { _db.DrivePhrases.Remove(entity); return(Save()); }
public bool Create(DrivePhrase entity) { _db.DrivePhrases.Add(entity); return(Save()); }