Пример #1
0
        public bool UpdateContentByTitle(string title, StreamingContent newContent)
        {
            StreamingContent content = GetContentByTitle(title);

            if (content == null)
            {
                Console.WriteLine("This is not the content you're looking for...");
                return(false);
            }
            else
            {
                content.Title          = newContent.Title;
                content.Description    = newContent.Description;
                content.StarRating     = newContent.StarRating;
                content.MaturityRating = newContent.MaturityRating;
                content.Genre          = newContent.Genre;
                return(true);
            }
        }
Пример #2
0
        private void ShowContentByTitle()
        {
            Console.Clear();
            Console.WriteLine("Enter a title");
            string title = Console.ReadLine();

            StreamingContent content = _repo.GetContentByTitle(title);

            if (content == null)
            {
                Console.WriteLine("No content found");
            }
            else
            {
                DisplayContent(content);
            }

            Console.WriteLine("Press any key to continue...");
            Console.ReadKey();
        }
Пример #3
0
 private void DisplayContent(StreamingContent item)
 {
     Console.WriteLine($"{item.Title} ({item.StarRating} stars, {item.Genre}) - {item.Description}");
 }