public IActionResult Get(int testCaseId) { try { var testCase = _repository.GetTestCaseById(testCaseId); //need to map the collections of steps to the collection of step view models, so we will not return raw step return(Ok(Mapper.Map <IEnumerable <StepViewModel> >(testCase.Steps.OrderBy(s => s.Order).ToList()))); } catch (Exception ex) { _logger.LogError("Failed to get steps: {0}", ex); } return(BadRequest("Failer to get steps")); }
//[HttpGet("/{testCaseId}")] public IActionResult Edit(int Id) { TestCase testCase = _repository.GetTestCaseById(Id); return(View(testCase)); }