Exemplo n.º 1
0
        public async Task <ImdbEntity> GetFilmByName(string filmName)
        {
            try
            {
                string url    = $"{ConfigurationManager.AppSettings["apiUrl"]}{filmName}&{ConfigurationManager.AppSettings["apiToken"]}";
                var    result = await webClientHelper.GetWebRequest <ImdbEntity>(url);

                return(result);
            }
            catch (Exception e)
            {
                throw new Exception($"Internal f****d error: {e.Data}");
            }
        }
Exemplo n.º 2
0
        public async Task <ThemoviedbEntity> GetRandomFilm()
        {
            try
            {
                Random random = new Random();
                string url    = $"{ConfigurationManager.AppSettings["apiUrl2"]}{random.Next(2, 980)}?api_key={ConfigurationManager.AppSettings["themoviedbKey"]}";
                var    result = await webClientHelper.GetWebRequest <ThemoviedbEntity>(url);

                return(result);
            }
            catch (Exception e)
            {
                throw new Exception($"Internal f****d error: {e.Data}");
            }
        }