예제 #1
0
        public ActionResult <int> PostTag([FromBody] TagInputModel tagModel)
        {
            if (string.IsNullOrWhiteSpace(tagModel.Name))
            {
                return(BadRequest("Введите название тега"));
            }
            Mapper           mapper = new Mapper();
            TagDTO           tagDto = mapper.ConvertTagInputModelToTagDTO(tagModel);
            AuthorDataAccess tag    = new AuthorDataAccess();

            return(Ok(tag.AddTag(tagDto)));
        }