Ejemplo n.º 1
0
        static void Main(string[] args)
        {
            CurrencyConverterServiceClient client = new CurrencyConverterServiceClient();

            var result = client.ConvertToWord(3);

            Console.WriteLine(result);
            Console.ReadLine();
        }
Ejemplo n.º 2
0
        public CurrencyConverterModel(
            CurrencyConverterServiceClient currencyConverterServiceProxy,
            IEndpointBehavior endpointBehavior
            )
        {
            _currencyConverterServiceProxy = currencyConverterServiceProxy ?? throw new ArgumentNullException(nameof(currencyConverterServiceProxy));
            endpointBehavior = endpointBehavior ?? throw new ArgumentNullException(nameof(endpointBehavior));

            _currencyConverterServiceProxy.ChannelFactory.Endpoint.Behaviors.Add(endpointBehavior);
        }
Ejemplo n.º 3
0
        private void ExecuteConvertCommand()
        {
            if (!IsValid)
            {
                WordRepresentation = "Currency is out of range!";

                return;
            }

            using (CurrencyConverterServiceClient client = new CurrencyConverterServiceClient())
            {
                WordRepresentation = client.ConvertToWord(USDCurrency);
            }
        }