public ActionResult Edit(CommunicationPhrase model) { try { // TODO: Add update logic here if (!ModelState.IsValid) { return(View(model)); } var CommunicationPhrase = _mapper.Map <CommunicationPhrase>(model); var isSuccess = _repo.Update(CommunicationPhrase); 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 Delete(CommunicationPhrase entity) { _db.CommunicationPhrases.Remove(entity); return(Save()); }
public bool Update(CommunicationPhrase entity) { _db.CommunicationPhrases.Update(entity); return(Save()); }
public bool Create(CommunicationPhrase entity) { _db.CommunicationPhrases.Add(entity); return(Save()); }