private IShape GetShapeFromUser() { Console.WriteLine("Enter the serial no. for the shape you want to choose :"); Console.WriteLine("1. Cube"); Console.WriteLine("2. Sphere"); var serialNumber = int.Parse(Console.ReadLine()); switch (serialNumber) { case 1: return(_shapeFactory.GetShape(ShapeEnum.Cube)); case 2: return(_shapeFactory.GetShape(ShapeEnum.Sphere)); default: throw new ArgumentOutOfRangeException("Invalid input."); } }