コード例 #1
0
        public ActionResult Edit(AcheivementPhrase model)
        {
            try
            {
                // TODO: Add update logic here
                if (!ModelState.IsValid)
                {
                    return(View(model));
                }
                var AcheivementPhrase = _mapper.Map <AcheivementPhrase>(model);
                var isSuccess         = _repo.Update(AcheivementPhrase);
                if (!isSuccess)
                {
                    ModelState.AddModelError("", "Something Went Wrong!");
                    return(View(model));
                }

                return(RedirectToAction(nameof(Index)));
            }
            catch
            {
                ModelState.AddModelError("", "Something Went Wrong!");
                return(View(model));
            }
        }
コード例 #2
0
 public bool Delete(AcheivementPhrase entity)
 {
     _db.AcheivementPhrases.Remove(entity);
     return(Save());
 }
コード例 #3
0
 public bool Update(AcheivementPhrase entity)
 {
     _db.AcheivementPhrases.Update(entity);
     return(Save());
 }
コード例 #4
0
 public bool Create(AcheivementPhrase entity)
 {
     _db.AcheivementPhrases.Add(entity);
     return(Save());
 }