Example #1
0
        public async Task <PersonAddEditDTO> Edit(PersonAddEditDTO model)
        {
            var person = _mapper.Map <Person>(model);

            _uow.Persons.Update(person);
            _uow.Save();
            return(_mapper.Map <PersonAddEditDTO>(person));
        }
Example #2
0
        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;
            }
        }
Example #3
0
 public async Task <ActionResult <PersonAddEditDTO> > Edit([FromBody] PersonAddEditDTO model) => await _service.Edit(model);