public CognitiveServiceCall(ApiSelection apiSelection) { // this.webClient = new HttpClient(); // this.headerContents.ToList().ForEach(h => this.webClient.DefaultRequestHeaders.Add(h.Substring(0, h.IndexOf(':')), h.Substring(h.IndexOf(':')+1))); this.apiSelection = apiSelection; switch (this.apiSelection) { case ApiSelection.Sentiment: this.url = new Uri(sentimentApiUrl); break; case ApiSelection.KeyPhrase: this.url = new Uri(keyPhrasesApiUrl); break; case ApiSelection.LanguagesDetection: this.url = new Uri(languagesApiUrl); break; default: this.url = new Uri(string.Empty); break; } }
public MainViewModel() { Address = ConfigurationManager.AppSettings["WebSite"]; _selectedApi = ApiSelection.NetApi; GoToAddress(); }