示例#1
0
        public bool AddObstacle(int idChallenge, ChallengeCreation.ObstacleCreation obstacle)
        {
            var mappedObstacle = _mapper.Map <Obstacle>(obstacle);

            return(_challengeRepository.AddObstacle(idChallenge, mappedObstacle));
        }
示例#2
0
        public IActionResult AddObstacle([FromRoute(Name = "id")] int idChallenge, [FromRoute(Name = "idPath")] int idPath, ChallengeCreation.ObstacleCreation obstacle)
        {
            if (obstacle == null)
            {
                return(BadRequest());
            }

            var isSuccefull = _challengeCommand.AddObstacle(idChallenge, obstacle);

            if (!isSuccefull)
            {
                return(StatusCode(StatusCodes.Status500InternalServerError));
            }

            return(Ok());
        }