public Value Post([FromBody] Value value) { string solution = new MazeCalculator(value.Map).RetriveRoute(); value.Solution = solution; value.Steps = solution.Split('@').Length; return(value); }
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)); }