public async Task <string> CreateTestStepAsync([FromBody] TestStepViewModel request) { // HttpRequest res = null; var response = new ListModelResponse <TestStepViewModel>(); var testStepsDataModel = false; try { testStepsDataModel = await _teststepRepository.CreateTestStep(request.ToEntity()); if (testStepsDataModel) { // response.Message = String.Format("Created User Successfully"); response.Message = Messages.SuccessMsg; } else { //response.Message = String.Format("Create User failed"); response.Message = Messages.FailMsg; } } catch (Exception ex) { response.DidError = true; response.ErrorMessage = ex.Message; } return(response.Message); }
public async Task <string> UpdateUserAsync([FromBody] TestStepViewModel request, int teststepId) { //HttpRequest res = null; var response = new ListModelResponse <TestStepViewModel>(); var usersDataModel = false; try { usersDataModel = await _teststepRepository.UpdateTestStep(request.ToEntity(), teststepId); if (usersDataModel) { // response.Message = String.Format("Record Updated Successfully"); response.Message = Messages.SuccessMsg; } else { // response.Message = String.Format("Record Updation failed"); response.Message = Messages.FailMsg; } } catch (Exception ex) { response.DidError = true; response.ErrorMessage = ex.Message; } return(response.Message); }