DelimitedSerializerOptions Class
Definition
- Assembly
- Bodu.Text.Delimited.dll
- Package
- Bodu.Text.Delimited 1.0.0
Provides configuration for DelimitedSerializer, controlling column naming, case sensitivity, field inclusion, and the output delimiter, quote, and header behaviour.
public sealed class DelimitedSerializerOptions
- Inheritance
-
DelimitedSerializerOptions
- Inherited Members
- Extension Methods
Remarks
An options instance becomes read-only the first time it is used; mutating a property after that point throws InvalidOperationException. Share and reuse a configured instance rather than allocating one per call.
Constructors
DelimitedSerializerOptions()
Initializes a new instance of the DelimitedSerializerOptions class with general-purpose defaults.
public DelimitedSerializerOptions()
DelimitedSerializerOptions(DelimitedSerializerDefaults)
Initializes a new instance of the DelimitedSerializerOptions class from the specified defaults.
public DelimitedSerializerOptions(DelimitedSerializerDefaults defaults)
Parameters
defaultsDelimitedSerializerDefaultsThe defaults to initialize from.
Properties
Default
Gets the shared read-only default options.
public static DelimitedSerializerOptions Default { get; }
Property Value
- DelimitedSerializerOptions
The default options.
Delimiter
Gets or sets the output field delimiter, or '\0' to use the default comma.
public char Delimiter { get; set; }
Property Value
- char
The delimiter character.
Exceptions
- InvalidOperationException
Thrown when set after the options have become read-only.
IncludeFields
Gets or sets a value indicating whether public fields participate in addition to properties.
public bool IncludeFields { get; set; }
Property Value
Exceptions
- InvalidOperationException
Thrown when set after the options have become read-only.
IsReadOnly
Gets a value indicating whether the options have become read-only.
public bool IsReadOnly { get; }
Property Value
NoHeader
Gets or sets a value indicating whether the header row is suppressed on the write path and absent on the read path.
public bool NoHeader { get; set; }
Property Value
Exceptions
- InvalidOperationException
Thrown when set after the options have become read-only.
PropertyNameCaseInsensitive
Gets or sets a value indicating whether column-name matching on deserialization ignores case.
public bool PropertyNameCaseInsensitive { get; set; }
Property Value
Exceptions
- InvalidOperationException
Thrown when set after the options have become read-only.
PropertyNamingPolicy
Gets or sets the naming policy applied to column names, or null to use names verbatim.
public NamingPolicy? PropertyNamingPolicy { get; set; }
Property Value
- NamingPolicy
The column naming policy.
Exceptions
- InvalidOperationException
Thrown when set after the options have become read-only.
Quote
Gets or sets the output quote character, or '\0' to use the default double quote.
public char Quote { get; set; }
Property Value
- char
The quote character.
Exceptions
- InvalidOperationException
Thrown when set after the options have become read-only.
Applies to
| Product | Versions |
|---|---|
| .NET | 8, 10 |