public IActionResult Get() { //return new string[] { "value1", "value2" }; List <Agent> agents = new List <Agent>(); _agentRepository.GetAgents().ToList().ForEach(agent => { agents.Add(agent); }); var result = agents.Select(agent => new { Id = agent.Id, Name = agent.Name }); return(Ok(result.ToArray())); }