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 IAgentModel Get(int id) { var agent = _repo.GetById(id); return(_mapper.Map <AgentModel>(agent)); }