Ejemplo n.º 1
0
        public ActionResult <int> PostTagInTest(TestTagInputModel testTagModel)
        {
            Mapper           mapper     = new Mapper();
            TestTagDTO       testTagDto = mapper.ConvertTestTagInputModelToTestTagDTO(testTagModel);
            AuthorDataAccess tags       = new AuthorDataAccess();
            var test = tags.GetTestById(testTagModel.TestID);

            if (test == null)
            {
                return(BadRequest("Теста не существует"));
            }
            var tag = tags.GetTagById(testTagModel.TagID);

            if (tag == null)
            {
                return(BadRequest("Тега не существует"));
            }
            return(Ok(tags.TestTagCreate(testTagDto)));
        }