public bool CallApi() { try { var results = TVMazeCaller.CallApi_Sync(show.QueryableTitle); SetEpisodeList(results); return(true); } catch { return(false); } }
static void Main(string[] args) { Console.Write("Enter a tv show title : "); var name = Console.ReadLine(); var apiTitle = ConvertToApiTitle(name); var results = TVMazeCaller.CallApi_Sync(apiTitle); Console.WriteLine("Writing JSON from api to file"); using (StreamWriter output = new StreamWriter(File.Create(System.AppDomain.CurrentDomain.BaseDirectory + @"\..\..\..\" + name + "_reults.json"))) { output.Write(results); } }