public ActionResult <string> GetPayment(string id) { APIResponseData responseData = new APIResponseData(); responseData.StatusCode = 0; responseData.Message = "Failed."; if (string.IsNullOrEmpty(id) == true) { responseData.StatusCode = 2; responseData.Message = "Id is required."; goto skipToReturn; } try { var result = _TransactionsService.GetTransactionById(id); responseData.Message = "Successfully."; responseData.StatusCode = 1; responseData.Result.Data = result; } catch (Exception ex) { responseData.Message = "Something went wrong, please try again."; responseData.StatusCode = 0; EmailHelpers.SendEmail(new Common.DTO.ErrorInfo() { Section = $"AQ GetPayment, TransactionID : {id}", Exception = ex }); } skipToReturn: //label use to force return return(Ok(responseData)); //return "value"; }
public IActionResult Index(string value) { var trans = _TransactionsService.GetTransactionById(value); return(View(trans)); }