Interface IWriterConfiguration
- Namespace
- CsvHelper.Configuration
- Assembly
- CsvHelper.dll
Configuration used for the IWriter.
public interface IWriterConfiguration
Properties
AllowComments
Gets a value indicating if comments are allowed. True to allow commented out lines, otherwise false.
bool AllowComments { get; }
Property Value
BufferSize
Gets the size of the buffer used for parsing and writing CSV files. Default is 0x1000.
int BufferSize { get; }
Property Value
Comment
Gets the character used to denote a line that is commented out. Default is '#'.
char Comment { get; }
Property Value
CultureInfo
Gets the culture info used to read and write CSV files.
CultureInfo CultureInfo { get; }
Property Value
Delimiter
Gets the delimiter used to separate fields. Default is ',';
string Delimiter { get; }
Property Value
DynamicPropertySort
Gets the comparer used to order the properties of dynamic objects when writing. The default is null, which will preserve the order the object properties were created with.
IComparer<string>? DynamicPropertySort { get; }
Property Value
Escape
The character used to escape characters. Default is '"'.
char Escape { get; }
Property Value
ExceptionMessagesContainRawData
A value indicating if exception messages contain raw CSV data.
true
if exception contain raw CSV data, otherwise false
.
Default is true
.
bool ExceptionMessagesContainRawData { get; }
Property Value
HasHeaderRecord
Gets a value indicating if the CSV file has a header record. Default is true.
bool HasHeaderRecord { get; }
Property Value
IgnoreReferences
Gets a value indicating whether references should be ignored when auto mapping. True to ignore references, otherwise false. Default is false.
bool IgnoreReferences { get; }
Property Value
IncludePrivateMembers
Gets a value indicating if private member should be read from and written to. True to include private member, otherwise false. Default is false.
bool IncludePrivateMembers { get; }
Property Value
InjectionCharacters
Gets the characters that are used for injection attacks.
char[] InjectionCharacters { get; }
Property Value
- char[]
InjectionEscapeCharacter
Gets the character used to escape a detected injection.
char InjectionEscapeCharacter { get; }
Property Value
InjectionOptions
Gets the injection options.
InjectionOptions InjectionOptions { get; }
Property Value
IsNewLineSet
A value indicating if NewLine was set.
bool IsNewLineSet { get; }
Property Value
MemberTypes
Gets the member types that are used when auto mapping. MemberTypes are flags, so you can choose more than one. Default is Properties.
MemberTypes MemberTypes { get; }
Property Value
Mode
The mode. See CsvMode for more details.
CsvMode Mode { get; }
Property Value
NewLine
The newline string to use. Default is \r\n (CRLF). When writing, this value is always used. When reading, this value is only used if explicitly set. If not set, the parser uses one of \r\n, \r, or \n.
string NewLine { get; }
Property Value
Quote
Gets the character used to quote fields. Default is '"'.
char Quote { get; }
Property Value
ReferenceHeaderPrefix
Gets a callback that will return the prefix for a reference header.
ReferenceHeaderPrefix? ReferenceHeaderPrefix { get; }
Property Value
ShouldQuote
Gets a function that is used to determine if a field should get quoted when writing.
ShouldQuote ShouldQuote { get; }
Property Value
TrimOptions
Gets the field trimming options.
TrimOptions TrimOptions { get; }
Property Value
UseNewObjectForNullReferenceMembers
Gets a value indicating that during writing if a new object should be created when a reference member is null. True to create a new object and use it's defaults for the fields, or false to leave the fields empty for all the reference member's member.
bool UseNewObjectForNullReferenceMembers { get; }
Property Value
Methods
Validate()
Validates the configuration.
void Validate()