I have the following code to duplicate the members of a list X
times.
Although it works it doesn\'t feel particularly clean.
Live code example:
Perhaps something along the lines of:
var serviceEndPoints = splitEndPoints.SelectMany(t =>
Enumerable.Repeat(t, instances)).ToList();
That will give you "A,A,A,B,B,B,C,C,C". If you want "A,B,C,A,B,C,A,B,C":
var serviceEndPoints = Enumerable.Repeat(
splitEndPoints, instances).SelectMany(t => t).ToList();