static void Main(string[] args) { CurrencyConverterServiceClient client = new CurrencyConverterServiceClient(); var result = client.ConvertToWord(3); Console.WriteLine(result); Console.ReadLine(); }
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); }
private void ExecuteConvertCommand() { if (!IsValid) { WordRepresentation = "Currency is out of range!"; return; } using (CurrencyConverterServiceClient client = new CurrencyConverterServiceClient()) { WordRepresentation = client.ConvertToWord(USDCurrency); } }