예제 #1
0
        /// <summary>
        /// Writes the textual representation of the given values to the writer.
        /// </summary>
        /// <param name="values">The values to write.</param>
        /// <exception cref="ArgumentNullException">The values array is null.</exception>
        public async Task WriteAsync(object[] values)
        {
            if (values == null)
            {
                throw new ArgumentNullException(nameof(values));
            }
            if (!isSchemaWritten)
            {
                if (recordWriter.Metadata.Options.IsFirstRecordHeader)
                {
                    await recordWriter.WriteSchemaAsync();

                    await recordWriter.WriteRecordSeparatorAsync();

                    ++recordWriter.Metadata.RecordCount;
                }
                isSchemaWritten = true;
            }
            await recordWriter.WriteRecordAsync(values);

            await recordWriter.WriteRecordSeparatorAsync();

            ++recordWriter.Metadata.RecordCount;
            ++recordWriter.Metadata.LogicalRecordCount;
        }
예제 #2
0
        /// <summary>
        /// Writes the textual representation of the given values to the writer.
        /// </summary>
        /// <param name="values">The values to write.</param>
        /// <exception cref="ArgumentNullException">The values array is null.</exception>
        public async Task WriteAsync(object[] values)
        {
            if (values == null)
            {
                throw new ArgumentNullException(nameof(values));
            }
            if (!isSchemaWritten)
            {
                if (recordWriter.Metadata.ExecutionContext.Options.IsFirstRecordHeader)
                {
                    await recordWriter.WriteSchemaAsync().ConfigureAwait(false);

                    await recordWriter.WriteRecordSeparatorAsync().ConfigureAwait(false);

                    ++recordWriter.Metadata.PhysicalRecordNumber;
                }
                isSchemaWritten = true;
            }
            await recordWriter.WriteRecordAsync(values).ConfigureAwait(false);

            await recordWriter.WriteRecordSeparatorAsync().ConfigureAwait(false);

            ++recordWriter.Metadata.PhysicalRecordNumber;
            ++recordWriter.Metadata.LogicalRecordNumber;
        }
예제 #3
0
        /// <summary>
        /// Writes the textual representation of the given values to the writer.
        /// </summary>
        /// <param name="values">The values to write.</param>
        /// <exception cref="ArgumentNullException">The values array is null.</exception>
        public async Task WriteAsync(object[] values)
        {
            if (values == null)
            {
                throw new ArgumentNullException(nameof(values));
            }
            if (isFirstLine)
            {
                if (recordWriter.Options.IsFirstRecordHeader)
                {
                    await recordWriter.WriteSchemaAsync();

                    await recordWriter.WriteRecordSeparatorAsync();
                }
                isFirstLine = false;
            }
            await recordWriter.WriteRecordAsync(values);

            await recordWriter.WriteRecordSeparatorAsync();
        }