Example #1
0
        public ActionResult <TagReadDto> CreateTag(TagCreateDto TagCreateDto)
        {
            var TagModel = _mapper.Map <Tag>(TagCreateDto);

            _repository.CreateTag(TagModel);
            _repository.SaveChanges();
            var outPut = _mapper.Map <TagReadDto>(TagModel);

            return(CreatedAtRoute(nameof(GetTagById), new { ID = outPut.TagID }, outPut));
            //return Ok(_mapper.Map<TagReadDto>(TagModel));
        }