Пример #1
0
 public int RemoveFromProblem(ProblemTagDto problemTag)
 {
     using (IDbConnection dbConnection = Connection)
     {
         return(dbConnection.Execute(TagQueries.RemoveFromProblem, problemTag));
     }
 }
Пример #2
0
 public int AddToProblem(ProblemTagDto problemTag)
 {
     using (IDbConnection dbConnection = Connection)
     {
         return(dbConnection.Execute(TagQueries.AddToProblem, problemTag));
     }
 }
Пример #3
0
 public IActionResult AddToProblem([FromBody] ProblemTagDto problemTag)
 {
     if (_tagService.AddToProblem(problemTag))
     {
         return(Ok());
     }
     return(BadRequest());
 }
Пример #4
0
 public bool RemoveFromProblem(ProblemTagDto problemTag)
 {
     if (_tagRepository.RemoveFromProblem(problemTag) != 0)
     {
         return(true);
     }
     return(false);
 }
Пример #5
0
 public bool AddToProblem(ProblemTagDto problemTag)
 {
     if (_tagRepository.AddToProblem(problemTag) != 0)
     {
         return(true);
     }
     return(false);
 }
Пример #6
0
        public bool RemoveFromProblem(int tagId, int problemId)
        {
            var problemTag = new ProblemTagDto
            {
                ProblemId = problemId,
                TagId     = tagId
            };

            if (_tagRepository.RemoveFromProblem(problemTag) != 0)
            {
                return(true);
            }
            return(false);
        }