Ejemplo n.º 1
0
        static void Main(string[] args)
        {
            string userOption = "";

            while ((userOption = UserOption().ToUpper()) != "X")
            {
                switch (userOption)
                {
                case "1":
                    repository.ReadAll();
                    break;

                case "2":
                    repository.Create(UserOptionInsert());
                    break;

                case "3":
                    repository.Update(UserOptionFind(), UserOptionUpdate());
                    break;

                case "4":
                    repository.Delete(UserOptionFind());
                    break;

                case "5":
                    repository.ReadByID(UserOptionFind());
                    break;

                case "C":
                    Console.Clear();
                    break;

                default:
                    throw new ArgumentException("Invalid command!");
                }
            }
        }