ConstantAttribute Class
The constant value that will be used for every record when reading and writing. This value will always be used no matter what other mapping configurations are specified.
Namespace
CsvHelper.Configuration.Attributes
Interfaces
Base Types
  • Attribute
graph BT Type-->Base0["Attribute"] Type-.->Interface0["IMemberMapper"] click Interface0 "/CsvHelper/api/CsvHelper.Configuration.Attributes/IMemberMapper" Type-.->Interface1["IParameterMapper"] click Interface1 "/CsvHelper/api/CsvHelper.Configuration.Attributes/IParameterMapper" Type["ConstantAttribute"] class Type type-node

Syntax

[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Parameter, AllowMultiple = false, Inherited = true)]
public class ConstantAttribute : Attribute, IMemberMapper, IParameterMapper

Attributes

Type Description
AttributeUsage

Constructors

Name Summary
ConstantAttribute(object) The constant value that will be used for every record when reading and writing. This value will always be used no matter what other mapping configurations are specified.

Properties

Name Property Type Summary
Constant object
Gets the constant.

Methods

Name Return Value Summary
ApplyTo(MemberMap) void
Applies configuration to the given MemberMap.
ApplyTo(ParameterMap) void
Applies configuration to the given ParameterMap.