private static void Main(string[] args) { Setup(); bool exit = false; while (!exit) { Console.WriteLine("1 - a list of products with a category and supplier"); Console.WriteLine("2 - a list of employees with a region which they are responsible for"); Console.WriteLine("3 - statistics by regions: a number of employees per region"); Console.WriteLine("4 - a list \"employee - carriers who employee worked with\" (according to orders)"); Console.WriteLine("5 - add new employee and specify a list of territories which he is responsible for"); Console.WriteLine("6 - move products from one category to another category"); Console.WriteLine("7 - add a list of products with their suppliers and categories"); Console.WriteLine("8 - replace a product with a similar one in orders which are not processed yet"); Console.WriteLine("other - exit"); Console.Write("Enter key: "); var key = Console.ReadLine(); Console.WriteLine(); int intKey; int.TryParse(key, out intKey); switch (intKey) { case 1: var allProducts = _productRepository.GetAll().Take(10); PrintProducts(allProducts); break; case 2: var employees = _employeeRepository.GetAll().Take(10); PrintEmployees(employees); break; case 3: var regionStatistics = _statisticsRepository.GetStatisticsByRegion(); PrintRegionStatistics(regionStatistics); break; case 4: var shippersStatistics = _statisticsRepository.GetEmployeeShippersStatistics(); PrintShipperStatistics(shippersStatistics); break; case 5: var id = _employeeRepository.Add(GetNewEmployeeWithExistingTerritories()); PrintEmployees(new [] { _employeeRepository.Get(id) }); break; case 6: var products = _productRepository.GetAll().Where(x => x.SupplierId == 4); Console.WriteLine("BEFORE"); PrintProducts(products); _productRepository.ChangeProductsCategory(products, 3); Console.WriteLine("AFTER"); products = _productRepository.GetAll().Where(x => x.SupplierId == 4); PrintProducts(products); break; case 7: var newProducts = GetNewProducts(); _productRepository.AddProductList(newProducts); var allProductsWithInserted = _productRepository.GetAll(); var inserted = allProductsWithInserted.Skip(allProductsWithInserted.Count - newProducts.Count); PrintProducts(inserted); break; case 8: var existingOrders = new List <Order> { _orderRepository.Get(11070), _orderRepository.Get(11072), _orderRepository.Get(11077) }; Console.WriteLine("BEFORE"); PrintOrders(existingOrders); _orderRepository.ChangeProduct(existingOrders, 2, 1); var updatedOrders = new List <Order> { _orderRepository.Get(11070), _orderRepository.Get(11072), _orderRepository.Get(11077) }; Console.WriteLine("AFTER"); PrintOrders(updatedOrders); break; default: exit = true; break; } Console.WriteLine(); } }