title: Efficiently add items to a list<class> in parallel C#
body: <p>I have functioning code that splits the strings of one property in a list of class: Dataframe made of <code>string, string, string</code>. </p>
  
  <p>Right now I am declaring an empty Dataframe2 (<code>string,string[], string</code>) and appending items to the list using <code>Add</code></p>
  
  <pre><code>class Program
  
  {
  
  
      public static string[] SPString(string text)
      {
          string[] elements;
          elements = text.Split(' ');
          return elements;
      }
  
      //Structures
      public class Dataframe
      {
  
          public string Name { get; set; }
          public string Text { get; set; }
          public string Cat { get; set; }
      }
  
      public class Dataframe2
      {
  
          public string Name { get; set; }
          public string[] Text { get; set; }
          public string Cat { get; set; }
      }
  
  
  
      static void Main(string[] args)
      {
  
          List&lt;Dataframe&gt; doc = new List&lt;Dataframe&gt;{new Dataframe { Name = "Doc1", Text = "The quick brown cat", Cat = ""},
              new Dataframe { Name = "Doc2", Text = "The big fat cat", Cat = "Two"},
              new Dataframe { Name = "Doc4", Text = "The quick brown rat", Cat = "One"},
              new Dataframe { Name = "Doc3", Text = "Its the cat in the hat", Cat = "Two"},
              new Dataframe { Name = "Doc5", Text = "Mice and rats eat seeds", Cat = "One"},
          };
  
          // Can this be made more efficient?
          ConcurrentBag&lt;Dataframe2&gt; doc2 = new ConcurrentBag&lt;Dataframe2&gt;();
          Parallel.ForEach(doc, entry =&gt;
          {
              string s = entry.Text;
              string[] splitter = SPString(s);
              doc2.Add(new Dataframe2 {Name = entry.Name, Text = splitter, Cat =entry.Cat});
          } );
  
      }
  }
  </code></pre>
  
  <p>Is there a more efficient way to add stuff to a list using a parallel LINQ where Dataframe2 inherits the properties I did not modify? </p>