예제 #1
0
        public bool UpdateSkill(SkillUpdateModel skillUpdateModel)
        {
            bool  check = false;
            Skill skill = _unitOfWork.GetRepository <Skill>().FindById(skillUpdateModel.id);

            if (skill != null)
            {
                skill.SkillName = skillUpdateModel.Name;
                _unitOfWork.GetRepository <Skill>().Update(skill);
                _unitOfWork.Commit();
                check = true;
            }
            return(check);
        }
예제 #2
0
        public IActionResult UpdateSkill(SkillUpdateModel skillUpdateModel)
        {
            if (skillUpdateModel == null)
            {
                return(BadRequest("Incorrect Parameter"));
            }

            bool check = _skillLogic.UpdateSkill(skillUpdateModel);

            if (!check)
            {
                return(BadRequest("Update Error"));
            }

            return(Ok("Update Skill Success"));
        }