Exemple #1
0
        private static void CreateSerie()
        {
            Console.WriteLine("Adding a new Serie!");
            foreach (int index in Enum.GetValues(typeof(Gender)))
            {
                Console.WriteLine("{0}-{1}", index, Enum.GetName(typeof(Gender), index));
            }
            Console.Write("Type it the serie Gender from the options above: ");
            int newGender = int.Parse(Console.ReadLine());

            Console.Write("Type it the serie Tittle: ");
            string newTittle = Console.ReadLine();

            Console.Write("Type it the serie Start Year: ");
            int newYear = int.Parse(Console.ReadLine());

            Console.Write("Type it the serie Description: ");
            string newDescription = Console.ReadLine();

            Serie newSerie = new Serie(id: repository.NextId(),
                                       gender: (Gender)newGender,
                                       tittle: newTittle,
                                       year: newYear,
                                       description: newDescription);

            repository.Create(newSerie);
        }