Click or drag to resize

CsvColumnAttribute Properties

The CsvColumnAttribute type exposes the following members.

Properties
  NameDescription
Public propertyCultureName
Gets or sets the name of the culture that must be used to parse the field value. If this property is set, it overrides any culture-settings that may have been set in the CsvRecord-attribute.
Public propertyFieldIndex
Gets the index of the field in the CSV file.
Public propertyFormatString
Gets or sets the format string that is to be used when parsing the column value.
De following format strings are supported:
  • XXX - Serialize the property according to the format. I.e.: '000' in combination with integer value 7 results in "007".
  • [prefix]{0:XXX}[postfix] - Serialize the property according to the format. I.e.: 'a{0:000}b' in combination with integer value 7 results in "a007b".
  • X or -X (String properties only) - Serialize the property according to the format. I.e.: '-5' in combination with string value 'abc' results in "abc ".
  • [prefix]{0,X}[postfix] or [prefix]{0,-X}[postfix] (String properties only) - Serialize the property according to the format. I.e.: 'y{0,-5}z' in combination with string value 'abc' results in "yabc z".
  • true:[true string]|false:[false string] (Boolean properties only) - Serialize the property according to the format. I.e.: 'true:Y|false:N' in combination with boolean value 'True' results in "Y".
Public propertyNullString
Gets or sets the string that is used to identify a null-value. During serialization, this value is used when the property to which this attribute is applied equals . During deserialization, if the serialized value equals this null-string, or the default value is used.
Top
See Also