// 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); }
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()); } }