} // Providers public static UiServiceProvider GetUiServiceProviderFromKey(ProviderDiscoveryRoot discoveryXml, string serviceKey) { var providers = from discovery in discoveryXml.ServiceProviderDiscovery from provider in discovery.Providers let uiProvider = new UiServiceProvider(provider) where uiProvider.Key == serviceKey select uiProvider; return(providers.FirstOrDefault()); } // GetUiServiceProviderFromKey
} // GetUiServiceProviderFromKey private void Create(ProviderDiscoveryRoot discoveryXml) { var providers = from discovery in discoveryXml.ServiceProviderDiscovery from provider in discovery.Providers select provider; var uiProviders = from provider in providers select new UiServiceProvider(provider); var uiProvidersList = new List <UiServiceProvider>(providers.Count()); uiProvidersList.AddRange(uiProviders); Providers = uiProvidersList.AsReadOnly(); } // Create
public UiProviderDiscovery(ProviderDiscoveryRoot discoveryXml) { Create(discoveryXml); } // constructor