Table of Contents

Class CsvReflectionBinder<T>

Namespace
FlameCsv.Binding
Assembly
FlameCsv.Core.dll

Binds type members and constructor parameters to CSV fields using reflection.

public sealed class CsvReflectionBinder<T> : CsvReflectionBinder, ICsvTypeBinder<T> where T : unmanaged, IBinaryInteger<T>

Type Parameters

T

Token type

Inheritance
CsvReflectionBinder<T>
Implements

Constructors

CsvReflectionBinder(CsvOptions<T>, bool)

Creates an instance of CsvReflectionBinder<T>.

public CsvReflectionBinder(CsvOptions<T> options, bool ignoreUnmatched)

Parameters

options CsvOptions<T>
ignoreUnmatched bool

Properties

IgnoreUnmatched

Fields that could not be matched are ignored.

public bool IgnoreUnmatched { get; }

Property Value

bool

Methods

GetDematerializer<TValue>()

[RequiresUnreferencedCode("This code path uses reflection. Use the overloads accepting source generated CsvTypeMap for AOT/trimming compatible code.")]
[RequiresDynamicCode("This code path uses compiled expressions. Use the overloads accepting source generated CsvTypeMap for AOT/trimming compatible code.")]
public IDematerializer<T, TValue> GetDematerializer<TValue>()

Returns

IDematerializer<T, TValue>

Type Parameters

TValue

Remarks

Caches the return values based on the options.

GetMaterializer<TValue>()

Returns a materializer for TValue bound to column indexes.

[RequiresUnreferencedCode("This code path uses reflection. Use the overloads accepting source generated CsvTypeMap for AOT/trimming compatible code.")]
[RequiresDynamicCode("This code path uses compiled expressions. Use the overloads accepting source generated CsvTypeMap for AOT/trimming compatible code.")]
public IMaterializer<T, TValue> GetMaterializer<TValue>()

Returns

IMaterializer<T, TValue>

Type Parameters

TValue

Remarks

Caches the return values based on the options.

Exceptions

CsvBindingException

Options is configured not to write a header, but TValue has no index binding.

GetMaterializer<TValue>(ReadOnlySpan<string>)

Returns a materializer for TValue bound to a CSV header.

[RequiresUnreferencedCode("This code path uses reflection. Use the overloads accepting source generated CsvTypeMap for AOT/trimming compatible code.")]
[RequiresDynamicCode("This code path uses compiled expressions. Use the overloads accepting source generated CsvTypeMap for AOT/trimming compatible code.")]
public IMaterializer<T, TValue> GetMaterializer<TValue>(ReadOnlySpan<string> headers)

Parameters

headers ReadOnlySpan<string>

Returns

IMaterializer<T, TValue>

Type Parameters

TValue

Remarks

Caches the return values based on the options and headers.