Ejemplo n.º 1
0
        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));
            }
        }
Ejemplo n.º 2
0
 public bool Update(DrivePhrase entity)
 {
     _db.DrivePhrases.Update(entity);
     return(Save());
 }
Ejemplo n.º 3
0
 public bool Delete(DrivePhrase entity)
 {
     _db.DrivePhrases.Remove(entity);
     return(Save());
 }
Ejemplo n.º 4
0
 public bool Create(DrivePhrase entity)
 {
     _db.DrivePhrases.Add(entity);
     return(Save());
 }