public WindGenerator Update(string city) { var binding = new NetTcpBinding(); IPEndPoint ipAddress = RoleEnvironment.Roles["WeatherWorkerRole"].Instances[0].InstanceEndpoints["InternalRequest"].IPEndpoint; ChannelFactory <IWeather> factory = new ChannelFactory <IWeather>(binding, new EndpointAddress($"net.tcp://{ipAddress}/InternalRequest")); proxy = factory.CreateChannel(); return(proxy.GetWindGenerator(city)); }
private void AddWeatherToList() { foreach (string city in cities) { this.Dispatcher.Invoke((Action)(() => { windGenerators.Add(proxy.GetWindGenerator(city)); g.Powers[city].Add(windGenerators[windGenerators.Count - 1].Power); })); } }