Beispiel #1
0
        public Value Post([FromBody] Value value)
        {
            string solution = new MazeCalculator(value.Map).RetriveRoute();

            value.Solution = solution;
            value.Steps    = solution.Split('@').Length;

            return(value);
        }
Beispiel #2
0
        public IActionResult Post([FromBody] Value value)
        {
            if (!ModelState.IsValid || value.Map.Length == 0)
            {
                return(BadRequest(ModelState));
            }

            string solution = new MazeCalculator(value.Map).RetriveRoute();

            value.Solution = solution;
            value.Steps    = solution.Split('@').Length;

            return(CreatedAtAction("Get", new { value.Steps, value.Solution }, value));
        }