Ejemplo n.º 1
0
        protected async override Task <object> OnPerform()
        {
            var switchContract = JsonConvert.SerializeObject(_switchPrepayContract);
            var content        = new StringContent(switchContract, Encoding.UTF8, ApplicationJSON);
            var response       = await _fuelPumpRestClient.SwitchPrepay(content);

            var data = await response.Content.ReadAsStringAsync();

            switch (response.StatusCode)
            {
            case HttpStatusCode.OK:
                var success = new DeSerializer().MapBool(data);
                return(success);

            default:
                return(await HandleExceptions(response));
            }
        }