示例#1
0
        public IActionResult GetSortedFile()
        {
            NumArrayData sorted = _sorter.GetSorted();

            if (sorted == null)
            {
                return(StatusCode(500, "Could not get sorted."));
            }

            NumArrayDataRW numArrayDataR = _mapper.Map <NumArrayData, NumArrayDataRW>(sorted);

            return(Ok(numArrayDataR));
        }
示例#2
0
        public IActionResult SortFile(NumArrayDataRW numArrayDataW)
        {
            NumArrayData numArrayData = _mapper.Map <NumArrayDataRW, NumArrayData>(numArrayDataW);

            var result = _sorter.Sort(numArrayData);

            if (result)
            {
                var numArrayDataR = _mapper.Map <NumArrayData, NumArrayDataRW>(numArrayData);
                return(Created(nameof(GetSortedFile), numArrayDataR));
            }
            else
            {
                return(StatusCode(500, "Could not sort."));
            }
        }