public IActionResult Post([FromBody] Agent value) { if (value.Id == 0) { _agentRepository.InsertAgent(value); } else { _agentRepository.UpdateAgent(value); } _agentRepository.Save(); return(Ok(value)); }
public ActionResult AddAgent(AddAgent agent) { AgentRepository repository = new AgentRepository(); Agents agentToAdd = new Agents { name = agent.agentName }; repository.Save(agentToAdd); return(RedirectToAction("Index")); }
public ActionResult AddAgent(AddAgent agent) { AgentRepository repository = new AgentRepository(); Agents agentToAdd = new Agents { name = agent.agentName }; repository.Save(agentToAdd); return RedirectToAction("Index"); }