C# Function Chaining

c#, chaining

Solution

Because AddRange function does not return a value. You might need to perform this in two steps:

List<int> intrs = new List<int>();
intrs.AddRange(new int[]{1,2,3,45});

Problem

Why do i receive error in the following declaration ? ``` List<int> intrs = new List<int>().AddRange(new int[]{1,2,3,45}); ``` Error :Can not convert type void to List ?

Original source