public void Generate() { while (Active) { var buyer = GetCollectionItem(_businessService.GetAllClients().Where(x => x.SecondName != "Тиньков").ToList()); var seller = GetCollectionItem(_businessService.GetAllClients().ToList() .Where(x => x != buyer) .Where(x => x.Stocks.Any()) .ToList()); var stock = GetCollectionItem(seller.Stocks); var amount = GetValue(stock); var inOperationStock = new Stock { Quantity = amount, StockType = stock.StockType, Traider = buyer }; _businessService.ProcessTrade(seller, buyer, inOperationStock); Thread.Sleep(200); } }