title: Using IEnumerable<T> as an input to a method
body: <p>The following code produces an error on the generic T, and I don't understand why. Can anyone explain what I am doing wrong, and what the proper way to do it is? </p>
  
  <p>Code:</p>
  
  <pre><code>public static class CSVWriter
  {
      public static void WriteData(string fileName, string path, IEnumerable&lt;T&gt; data)
      {
          string filePath = path + fileName + ".csv";
          if (!File.Exists(filePath))
          {
              File.Create(filePath).Close();
          }
          StringBuilder sb = new StringBuilder();
          foreach (var item in data)
          {
              sb.AppendLine(data.ToString());
          }
  
          File.AppendAllText(filePath, sb.ToString());
      }
  }
  </code></pre>
  
  <p>Error:</p>
  
  <pre><code>Error CS0246
  The type or namespace name 'T' could not be found 
  (are you missing a using directive or an assembly reference?)
  </code></pre>