Collection Initializers with Parameter Arrays C# with Example
You can mix normal parameters and parameter arrays: public class LotteryTicket : IEnumerable{ public int[] LuckyNumbers; public string UserName; public void Add(string userName, params int[] luckyNumbers){ UserName = userName; Lottery = luckyNumbers; } } This syntax is now possible: var Tickets = new List{ {"Mr Cool" , 35663, 35732, 12312, 75685}, {"Bruce" , 26874, 66677, 24546, 36483, 46768, 24632, 24527}, {"John Cena", 25446, 83356, 65536, 23783, 24567, 89337} }