title: Create duplicate items in a list
body: <p>I have the following code to duplicate the members of a list <code>X</code> times.</p>
  
  <p>Although it works it doesn't feel particularly clean.</p>
  
  <p>Live code example: <a href="http://rextester.com/UIVZVX7918" rel="noreferrer">http://rextester.com/UIVZVX7918</a></p>
  
  <pre><code>public static List&lt;ServiceEndPoint&gt; GetServiceEndPoints()
  {
      const string source = "http://webSiteA.asmx,http://webSiteB.asmx";
      const int instances = 3;
  
      var splitEndPoints =  source.Split(new[] { "," }, StringSplitOptions.RemoveEmptyEntries)
                                      .Select((s, i) =&gt; new ServiceEndPoint
                                                                  {
                                                                      Index = i,
                                                                      Uri = s
                                                                  })
                                                                  .ToList();
  
      // Duplicate the contents of splitEndPoints "instances" number of times
      var serviceEndPoints = new List&lt;ServiceEndPoint&gt;();
      foreach (var point in splitEndPoints)
      {
          for (var i = 0; i &lt; instances; i++)
          {
              serviceEndPoints.Add(point);
          }
      }
  
      return serviceEndPoints;
  }
  
  public class ServiceEndPoint
  {
      public int Index { get; set; }
      public string Uri { get; set; }
  }
  </code></pre>
  
  <p>Is there a better way of doing it?</p>