Example #1
0
        private static ActionResult HandleResult(FaultCode fault, ControllerBase controller)
        {
            switch (fault)
            {
            case FaultCode.CoinNotProvided:
            case FaultCode.ErrorRetrievingCoinPrice:
            case FaultCode.FailedToReadResponseData:
            case FaultCode.CoinUnknownOrNotAccepted:
                return(controller.BadRequest(new FaultCodeResponse()
                {
                    FaultCode = fault.ToString()
                }));

            case FaultCode.Fail:
            default:
                return(new StatusCodeResult(500));
            }
        }