Beispiel #1
0
        async Task PrintAllAsync()
        {
            IEnumerable <Cast> castCollection = await castService.GetAllCastAsync();

            foreach (var item in castCollection)
            {
                Console.WriteLine(item.Id + " \t " + item.Name + " \t " + item.Gender + " \t " + item.TmdbUrl + " \t " + item.ProfilePath);
            }
        }
Beispiel #2
0
        async Task PrintAllAsync()
        {
            try
            {
                IEnumerable <Cast> castCollection = await castService.GetAllCastAsync();

                if (castCollection != null)
                {
                    foreach (Cast item in castCollection)
                    {
                        Console.WriteLine(item.Id + " \t " + item.Name + " \t " + item.Gender);
                    }
                }
                else
                {
                    Console.WriteLine("No data");
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
            }
        }