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
object
CsvReflectionBinder<T>
Implements

Constructors

CsvReflectionBinder(CsvOptions<T>)

Creates an instance of CsvReflectionBinder<T>.

public CsvReflectionBinder(CsvOptions<T> options)

Parameters

options CsvOptions<T>

Methods

GetDematerializer<TValue>()

Returns a dematerializer for 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.

Exceptions

CsvBindingException

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

GetMaterializer<TValue>()

Returns a materializer for TValue bound to field 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>(ImmutableArray<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>(ImmutableArray<string> headers)

Parameters

headers ImmutableArray<string>

Returns

IMaterializer<T, TValue>

Type Parameters

TValue

Remarks

Caches the return values based on the options and headers.