Namespace
CsvHelper
Assembly
CsvHelper.dll
Inheritance
object Attribute CsvValidateAttribute
Builds
net10.0 netstandard2.1 netstandard2.0 net47

Remarks

The method is a static method of the type (of the map class, for a CsvRecordMapAttribute), of any accessibility, that takes one parameter of the member's type and returns bool: true for a valid value. It runs after the field is read, so it sees the value as the member gets it (null for an empty field of a nullable member, the value of CsvDefaultAttribute). It does not run when the column of an optional member is missing, nor when records are written.

Constructors

CsvValidateAttribute(string)

Added in v34.0.0
public CsvValidateAttribute(string methodName)

Checks the member's value with the static method called methodName.

Parameters

methodNamestring
The name of the method, such as nameof(IsValidAge).

View source

Properties

MethodName

Added in v34.0.0
public string MethodName { get; }

The name of the method that checks the value.

Property value

string

View source