public void ProcessChannels() { try { ChannelsServiceClient client = new ChannelsServiceClient(); List <ChannelContract> channels = client.GetChannels().ToList(); foreach (ChannelContract channel in channels) { try { if (channel != null) { ChannelsProcessorFactory.Create(channel).Process(); } } catch (Exception e) { // Сделать обработку ошибок } } } catch (Exception e) { // Сделать обработку ошибок } }
protected void SaveNewsItems() { ChannelsServiceClient client = new ChannelsServiceClient(); client.AddNewsItems(NewsItems.ToArray()); }