public GetPositionDto Add(CreatePostionDto createPostionDto) { var position = _mapper.Map <Position>(createPostionDto); var positionInDb = _unitOfWork.PositionRepository.Add(position); _unitOfWork.SaveChanges(); return(_mapper.Map <GetPositionDto>(positionInDb));; }
public IActionResult Create(CreatePostionDto createPostionDto) { var position = _positionService.Add(createPostionDto); return(CreatedAtAction(nameof(Get), new { id = position.Id }, position)); }