public int Add(Dto.Input.UserDto entity) { var newEntity = Mapper.Map <User>(entity); _unitOfWork.Users.Add(newEntity); _unitOfWork.Complete(); return(newEntity.Id); }
public int Update(int id, Dto.Input.UserDto entity) { entity.Id = id; var oldEntity = _unitOfWork.Users.Get(id); Mapper.Map(entity, oldEntity); _unitOfWork.Users.Update(oldEntity); _unitOfWork.Complete(); return(oldEntity?.Id ?? 0); }