Generation

generate functionThu, 22 Dec 2022

Join cars objects with colors object and get combination results

var color = new List<string>(){ "red", "blue", "yellow"}; var cars = new List<string>(){"ferrari", "bmw", "toyota"}; var colorCars = color.SelectMany(col => cars, (col, car) => new {color = col, car = car}); colorCars.ToList().ForEach(item => Console.WriteLine(item));

Questions about programming?Chat with your personal AI assistant