/// <summary>
        /// Asynchronously writes a record to this <c>CsvWriter</c>.
        /// </summary>
        /// <remarks>
        /// All values within <paramref name="record"/> are written in the order they appear.
        /// </remarks>
        /// <param name="record">
        /// The record to write.
        /// </param>
        /// <returns>
        /// A <see cref="Task"/> representing the asynchronous operation.
        /// </returns>
        public async Task WriteRecordAsync(RecordBase record)
        {
            Debug.Assert(this.bufferBuilder.Length == 0, "Expecting buffer to be empty.");

            this.EnsureNotDisposed();
            record.AssertNotNull("record");
            this.WriteRecordToBuffer(record);
            await this.FlushBufferToTextWriterAsync().ConfigureAwait(false);
        }
Exemple #2
0
        /// <summary>
        /// Writes a record to this <c>CsvWriter</c>.
        /// </summary>
        /// <remarks>
        /// All values within <paramref name="record"/> are written in the order they appear.
        /// </remarks>
        /// <param name="record">
        /// The record to write.
        /// </param>
        public void WriteRecord(RecordBase record)
        {
            Debug.Assert(this.bufferBuilder.Length == 0, "Expecting buffer to be empty.");

            this.EnsureNotDisposed();
            record.AssertNotNull("record");
            this.WriteRecordToBuffer(record);
            this.FlushBufferToTextWriter();
        }