Exemplo n.º 1
0
        public async Task <Charge> GetChargeAsync(int chargeId)
        {
            try
            {
                using (var client = new ExpenseServiceClient())
                {
                    return(await client.GetChargeAsync(chargeId));
                }
            }
            catch (System.ServiceModel.EndpointNotFoundException)
            {
                this._viewService.ShowError("Could not connect to configured service.");
            }
            catch (Exception ex)
            {
                this._viewService.ShowError(String.Format("Error in WCF call: {0}", ex.Message));
            }

            return(new Charge());
        }
        public async Task<Charge> GetChargeAsync(int chargeId)
        {
            try
            {
                using (var client = new ExpenseServiceClient())
                {
                    return await client.GetChargeAsync(chargeId);
                }
            }
            catch (System.ServiceModel.EndpointNotFoundException)
            {
                this._viewService.ShowError("Could not connect to configured service.");
            }
            catch (Exception ex)
            {
                this._viewService.ShowError(String.Format("Error in WCF call: {0}", ex.Message));
            }

            return new Charge();
        }