Ejemplo n.º 1
0
        public GetPositionDto Add(CreatePostionDto createPostionDto)
        {
            var position     = _mapper.Map <Position>(createPostionDto);
            var positionInDb = _unitOfWork.PositionRepository.Add(position);

            _unitOfWork.SaveChanges();
            return(_mapper.Map <GetPositionDto>(positionInDb));;
        }
Ejemplo n.º 2
0
        public IActionResult Create(CreatePostionDto createPostionDto)
        {
            var position = _positionService.Add(createPostionDto);

            return(CreatedAtAction(nameof(Get), new { id = position.Id }, position));
        }