public IActionResult EnableAgentById([FromRoute] int agentId) { AgentModel agent = _repository.GetById(agentId); agent.Status = true; _repository.Update(agent); _logger.LogInformation($"Подключение агента {agentId}"); return(Ok()); }
public IActionResult EnableAgentById([FromRoute] int agentId) { _logger.LogInformation($"Включение агента {agentId}"); var agent = _repository.GetById(agentId); if (agent == null) { return(NotFound()); } if (!agent.Active) { agent.Active = true; _repository.Update(agent); } return(Ok()); }
public bool Update(IAgentModel model) { var agent = _mapper.Map <Agent>(model); return(_repo.Update(agent)); }