Example #1
0
        /// <summary>
        /// Ends writing of the current record
        /// and starts a new record. This is used
        /// when manually writing records with WriteField.
        /// </summary>
        public virtual void NextRecord()
        {
            CheckDisposed();

            serializer.Write(currentRecord.ToArray());
            currentRecord.Clear();
        }
Example #2
0
 /// <summary>
 /// Ends writing of the current record and starts a new record.
 /// This needs to be called to serialize the row to the writer.
 /// </summary>
 public virtual void NextRecord()
 {
     try
     {
         serializer.Write(context.Record.ToArray());
         context.Record.Clear();
         context.Row++;
     }
     catch (Exception ex)
     {
         throw ex as CsvHelperException ?? new CsvWriterException(context, "An unexpected error occurred.", ex);
     }
 }
Example #3
0
 /// <summary>
 /// Ends writing of the current record and starts a new record.
 /// This needs to be called to serialize the row to the writer.
 /// </summary>
 public virtual void NextRecord()
 {
     try
     {
         serializer.Write(currentRecord.ToArray());
         currentRecord.Clear();
         row++;
     }
     catch (Exception ex)
     {
         var csvHelperException = ex as CsvHelperException ?? new CsvWriterException("An unexpected error occurred.", ex);
         ExceptionHelper.AddExceptionData(csvHelperException, Row, null, null, null, currentRecord.ToArray());
         throw csvHelperException;
     }
 }
Example #4
0
 /// <summary>
 /// Ends writing of the current record
 /// and starts a new record. This is used
 /// when manually writing records with WriteField.
 /// </summary>
 public virtual void NextRecord()
 {
     serializer.Write(currentRecord.ToArray());
     currentRecord.Clear();
     row++;
 }