CsvFieldMapping Class
Definition
Namespace: DataStandardizer.File.CSV
The details of a single mapping between a CSV field and a model property: the field identity, optionality, constant or generated value, converters, and the property type.
Syntax
public sealed class CsvFieldMapping
Remarks
You do not construct or set this type directly — its constructor and property setters are internal. Mappings are built from CsvFieldMappingAttribute declarations or through the fluent CsvFileMappingBuilder, and surfaced (read-only) through a CsvFileMapper / ICsvFileMapper. The properties below are all publicly readable.
Properties
| Property | Signature | Notes |
|---|---|---|
ConstantValue | object? ConstantValue { get; } | A constant value for the field. |
FieldIndex | int? FieldIndex { get; } | The mapped field index. Setting a negative value throws ArgumentOutOfRangeException. |
FieldName | string? FieldName { get; } | The mapped field name. |
FromStringConverter | Delegate? FromStringConverter { get; } | A CsvFieldConvertFromString delegate (reading only). |
IsOptional | bool IsOptional { get; } | true if the field is optional. |
PropertyType | Type PropertyType { get; } | The type of the mapped property. |
ToStringConverter | Delegate? ToStringConverter { get; } | A CsvFieldConvertToString delegate (writing only). |
TypeConverterType | Type? TypeConverterType { get; } | The TypeConverter type used for (de)serialization. |
Validator | Delegate? Validator { get; } | A CsvFieldValidate delegate. |
VariableValueGenerator | Delegate? VariableValueGenerator { get; } | A CsvFieldGenerate delegate. |
Applies to
Targets netstandard1.3, netstandard2.0, net8.0, and net10.0. The nullable reference annotations apply to the net8.0 and net10.0 builds.
See also
</content>