/// <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(); }
/// <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); } }
/// <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; } }
/// <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++; }