Пример #1
0
        // Update Status
        public Skill ChangeStatus(RequestUpdateStatusSkill model)
        {
            var entity = GetSkillById(model.Id);

            if (entity.Activated == true)
            {
                entity.Activated = false;
            }
            else
            {
                entity.Activated = true;
            }
            return(entity);
        }
Пример #2
0
 public IActionResult ChangeStatus(int id, [FromBody] RequestUpdateStatusSkill _skill)
 {
     if (id != _skill.Id)
     {
         return(NotFound());
     }
     if (ModelState.IsValid)
     {
         Skill skill = _skillServices.ChangeStatus(_skill);
         _skillServices.Commit();
         _skill.ToModel(skill);
         return(Ok(_skill));
     }
     else
     {
         return(BadRequest());
     }
 }