public async Task <PersonAddEditDTO> Edit(PersonAddEditDTO model) { var person = _mapper.Map <Person>(model); _uow.Persons.Update(person); _uow.Save(); return(_mapper.Map <PersonAddEditDTO>(person)); }
public async Task <PersonAddEditDTO> Add(PersonAddEditDTO model) { try { var person = _mapper.Map <Person>(model); _uow.Persons.Insert(person); _uow.Save(); return(_mapper.Map <PersonAddEditDTO>(person)); } catch (Exception e) { throw e; } }
public async Task <ActionResult <PersonAddEditDTO> > Edit([FromBody] PersonAddEditDTO model) => await _service.Edit(model);