Table of Contents

Interface IReaderConfiguration

Namespace
CsvHelper.Configuration
Assembly
CsvHelper.dll

Configuration used for the IReader.

public interface IReaderConfiguration : IParserConfiguration
Inherited Members

Properties

DetectColumnCountChanges

Gets a value indicating whether changes in the column count should be detected. If true, a BadDataException will be thrown if a different column count is detected.

bool DetectColumnCountChanges { get; }

Property Value

bool

GetConstructor

Chooses the constructor to use for constructor mapping.

GetConstructor GetConstructor { get; }

Property Value

GetConstructor

GetDynamicPropertyName

Gets the name to use for the property of the dynamic object.

GetDynamicPropertyName GetDynamicPropertyName { get; }

Property Value

GetDynamicPropertyName

HasHeaderRecord

Gets a value indicating if the CSV file has a header record. Default is true.

bool HasHeaderRecord { get; }

Property Value

bool

HeaderValidated

Gets the function that is called when a header validation check is ran. The default function will throw a ValidationException if there is no header for a given member mapping. You can supply your own function to do other things like logging the issue instead of throwing an exception.

HeaderValidated? HeaderValidated { get; }

Property Value

HeaderValidated

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

bool

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

bool

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

MemberTypes

MissingFieldFound

Gets the function that is called when a missing field is found. The default function will throw a MissingFieldException. You can supply your own function to do other things like logging the issue instead of throwing an exception.

MissingFieldFound? MissingFieldFound { get; }

Property Value

MissingFieldFound

PrepareHeaderForMatch

Prepares the header field for matching against a member name. The header field and the member name are both ran through this function. You should do things like trimming, removing whitespace, removing underscores, and making casing changes to ignore case.

PrepareHeaderForMatch PrepareHeaderForMatch { get; }

Property Value

PrepareHeaderForMatch

ReadingExceptionOccurred

Gets the function that is called when a reading exception occurs. The default function will re-throw the given exception. If you want to ignore reading exceptions, you can supply your own function to do other things like logging the issue.

ReadingExceptionOccurred? ReadingExceptionOccurred { get; }

Property Value

ReadingExceptionOccurred

ReferenceHeaderPrefix

Gets a callback that will return the prefix for a reference header.

ReferenceHeaderPrefix? ReferenceHeaderPrefix { get; }

Property Value

ReferenceHeaderPrefix

ShouldSkipRecord

Gets the callback that will be called to determine whether to skip the given record or not.

ShouldSkipRecord? ShouldSkipRecord { get; }

Property Value

ShouldSkipRecord

ShouldUseConstructorParameters

Determines if constructor parameters should be used to create the class instead of the default constructor and members.

ShouldUseConstructorParameters ShouldUseConstructorParameters { get; }

Property Value

ShouldUseConstructorParameters