private static void InsertSerie() { Console.WriteLine("Insert new serie"); foreach (int i in Enum.GetValues(typeof(Genre))) { Console.WriteLine("{0}-{1}", i, Enum.GetName(typeof(Genre), i)); } Console.Write("Enter the desired option: "); int inGenre = int.Parse(Console.ReadLine()); Console.Write("Enter with serie title: "); string inTitle = Console.ReadLine(); Console.Write("Enter with serie year: "); int inYear = int.Parse(Console.ReadLine()); Console.Write("Enter with serie description: "); string inDescription = Console.ReadLine(); Serie newSerie = new Serie(id: repository.NextId(), genre: (Genre)inGenre, title: inTitle, year: inYear, description: inDescription); repository.Insert(newSerie); }
private static void InsertSerie() { Console.WriteLine("Inserir nova série"); foreach (int i in Enum.GetValues(typeof(Genre))) { Console.WriteLine("{0} - {1}", i, Enum.GetName(typeof(Genre), i)); } Console.Write("Digite o gênero entre as opções acima: "); int genreEntry = int.Parse(Console.ReadLine()); Console.Write("Digite o Título da Série: "); string titleEntry = Console.ReadLine(); Console.Write("Digite o Ano de Inicio da Série: "); int yearEntry = int.Parse(Console.ReadLine()); Console.Write("Digite a Descrição da Série: "); string descriptionEntry = Console.ReadLine(); Serie newSerie = new Serie(id: repository.NextId(), genre: (Genre)genreEntry, title: titleEntry, year: yearEntry, description: descriptionEntry); repository.Insert(newSerie); }