Table of Contents

Class CsvTypeMap

Namespace
FlameCsv.Binding
Assembly
FlameCsv.Core.dll

Base class providing throw helpers for CsvTypeMap<T, TValue>.

public abstract class CsvTypeMap
Inheritance
CsvTypeMap
Derived
CsvTypeMap<T, TValue>

Properties

IgnoreUnmatched

If true, headers that cannot be matched to a member are ignored instead of throwing.

public bool IgnoreUnmatched { get; init; }

Property Value

bool

NoCaching

Disables caching of de/materializers for this type map.

public bool NoCaching { get; init; }

Property Value

bool

Remarks

Caching is enabled by default. The cache is used on calls to public methods on the base class CsvTypeMap.

See Also

TargetType

Returns the mapped type.

protected abstract Type TargetType { get; }

Property Value

Type

ThrowOnDuplicate

If true, multiple header field matches to a single member throw an exception. The default behavior does not attempt to match already matched members.

public bool ThrowOnDuplicate { get; init; }

Property Value

bool

Methods

ThrowDuplicate(string, string, ReadOnlySpan<string>)

Throws an exception for header field being bound multiple times.

[DoesNotReturn]
[EditorBrowsable(EditorBrowsableState.Never)]
protected void ThrowDuplicate(string member, string field, ReadOnlySpan<string> headers)

Parameters

member string
field string
headers ReadOnlySpan<string>

Exceptions

CsvBindingException
See Also

ThrowNoFieldsBound(ReadOnlySpan<string>)

Throws an exception for header that couldn't be bound to any member of parameter.

[DoesNotReturn]
[EditorBrowsable(EditorBrowsableState.Never)]
protected void ThrowNoFieldsBound(ReadOnlySpan<string> headers)

Parameters

headers ReadOnlySpan<string>

Exceptions

CsvBindingException
See Also

ThrowRequiredNotRead(IEnumerable<string>, ReadOnlySpan<string>)

Throws an exception for a required member or parameter that wasn't bound to any of the headers.

[DoesNotReturn]
[EditorBrowsable(EditorBrowsableState.Never)]
protected void ThrowRequiredNotRead(IEnumerable<string> members, ReadOnlySpan<string> headers)

Parameters

members IEnumerable<string>
headers ReadOnlySpan<string>

Exceptions

CsvBindingException

ThrowUnmatched(string, int)

Throws an exception for header field that wasn't matched to any member or parameter.

[DoesNotReturn]
[EditorBrowsable(EditorBrowsableState.Never)]
protected void ThrowUnmatched(string field, int index)

Parameters

field string
index int

Exceptions

CsvBindingException
See Also