class Goods { public string Name { get;set; } public int Price { get; set; } public int Amount { get; set; } public string category { get; set; } public Goods(string name, int price, int amount, string category) { Name = name; Price = price; Amount = amount; this.category = category; } } class Category { public string Title { get; set; } public Category(string title) { Title = title; } } class Seller { public string Name { get; set; } public int Reviews { get; set; } public List GoodsList; public Seller(string name, int reviews, List goodsList) { Name = name; Reviews = reviews; GoodsList = goodsList; } } class Program { static void Main(string[] args) { List categories = new List() { new Category("Brawl"), new Category("Roblox"), new Category("Mine"), new Category("Pubg") }; List goods = new List() { new Goods("Gems", 100, 37,categories[0].Title), new Goods("Robux", 200, 5,categories[1].Title), new Goods("Robux", 300, 25,categories[1].Title), new Goods("Robux", 100, 50,categories[1].Title), new Goods("Acc", 2000, 3,categories[2].Title) }; List sellers = new List() { new Seller("TopSell", 111, new List() {goods[0], goods[2]}), new Seller("GameDealer", 222, new List() {goods[1]}), new Seller("CANE2280", 3178, new List() {goods[3]}), new Seller("SashaB116", 666, new List() {goods[4]}) }; List> data = new List>(); foreach (var sel in sellers) { foreach (var selGod in sel.GoodsList) { data.Add(new Tuple(selGod.category, selGod.Name, selGod.Amount, selGod.Price, sel.Name, sel.Reviews)); } } while (true) { Console.Write("Выберите метод сортировки:\n1. По убыванию\n2. По возрастанию\n>>> "); int ch0 = Convert.ToInt32(Console.ReadLine()); Console.Write( "Выберите метод сортировки:\n1. По категории\n2. По количеству\n3. По цене\n4. По отзывам\n>>> "); int ch = Convert.ToInt32(Console.ReadLine()); IOrderedEnumerable> filData = null; switch (ch) { case 1: if (ch0 == 2) filData = data.OrderBy(d => d.Item1); else filData = data.OrderByDescending(d => d.Item1); break; case 2: if (ch0 == 2) filData = data.OrderBy(d => d.Item3); else filData = data.OrderByDescending(d => d.Item3); break; case 3: if (ch0 == 2) filData = data.OrderBy(d => d.Item4); else filData = data.OrderByDescending(d => d.Item4); break; case 4: if (ch0 == 2) filData = data.OrderBy(d => d.Item6); else filData = data.OrderByDescending(d => d.Item6); break; } Console.WriteLine("Категор Предмет Кол-во Цена Продавец Отзывы"); foreach (var i in filData) { Console.WriteLine($"{i.Item1}\t {i.Item2}\t {i.Item3}\t {i.Item4}\t {i.Item5}\t {i.Item6}"); } } } }