public IHttpActionResult CreateAgent(CreateAgentBindingModel model) { if (!ModelState.IsValid) { return(BadRequest(ModelState.FirstError())); } var entity = AutoMapper.Mapper.Map <Agent>(model); _agentLogic.Add(entity); return(Ok()); }
private void btn_Add_Click(object sender, EventArgs e) { Agent temp = new Agent(textBoxFio.Text, textBoxPhoneNumber.Text); agentLogic.Add(temp); }