MemberMap<TClass, TMember> Class
Mapping info for a member to a CSV field.
Namespace
CsvHelper.Configuration
Base Types
graph BT Type-->Base0["MemberMap"] click Base0 "/CsvHelper/api/CsvHelper.Configuration/MemberMap" Base0-->Base1["object"] Type["MemberMap<TClass, TMember>"] class Type type-node

Syntax

public class MemberMap<TClass, TMember> : MemberMap

Type Parameters

Name Description
TClass
TMember

Constructors

Name Summary
MemberMap(MemberInfo) Creates a new MemberMap instance using the specified member.

Properties

Name Property Type Summary
Data MemberMapData
Gets the member map data.
Inherited from MemberMap
TypeConverterOption MemberMapTypeConverterOption
Type converter options.

Methods

Name Return Value Summary
Constant(object) MemberMap
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.
Inherited from MemberMap
Constant(TMember) MemberMap<TClass, TMember>
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.
Convert(ConvertFromString<TMember>) MemberMap<TClass, TMember>
Specifies an expression to be used to convert data in the row to the member.
Convert(ConvertToString<TClass>) MemberMap<TClass, TMember>
Specifies an expression to be used to convert the object to a field.
CreateGeneric(Type, MemberInfo) MemberMap
Creates an instance of MemberMap using the given Type and MemberInfo.
Inherited from MemberMap
static
Default(object, bool) MemberMap
The default value that will be used when reading when the CSV field is empty.
Inherited from MemberMap
Default(string, bool) MemberMap<TClass, TMember>
The default value that will be used when reading when the CSV field is empty. This value is not type checked and will use a ITypeConverter to convert the field. This could potentially have runtime errors.
Default(TMember, bool) MemberMap<TClass, TMember>
The default value that will be used when reading when the CSV field is empty.
Ignore() MemberMap<TClass, TMember>
Ignore the member when reading and writing. If this member has already been mapped as a reference member, either by a class map, or by automapping, calling this method will not ignore all the child members down the tree that have already been mapped.
Ignore() MemberMap
Ignore the member when reading and writing. If this member has already been mapped as a reference member, either by a class map, or by automapping, calling this method will not ignore all the child members down the tree that have already been mapped.
Inherited from MemberMap
Ignore(bool) MemberMap<TClass, TMember>
Ignore the member when reading and writing. If this member has already been mapped as a reference member, either by a class map, or by automapping, calling this method will not ignore all the child members down the tree that have already been mapped.
Ignore(bool) MemberMap
Ignore the member when reading and writing. If this member has already been mapped as a reference member, either by a class map, or by automapping, calling this method will not ignore all the child members down the tree that have already been mapped.
Inherited from MemberMap
Index(int, int) MemberMap<TClass, TMember>
When reading, is used to get the field at the given index. When writing, the fields will be written in the order of the field indexes.
Index(int, int) MemberMap
When reading, is used to get the field at the given index. When writing, the fields will be written in the order of the field indexes.
Inherited from MemberMap
Name(string[]) MemberMap<TClass, TMember>
When reading, is used to get the field at the index of the name if there was a header specified. It will look for the first name match in the order listed. When writing, sets the name of the field in the header record. The first name will be used.
Name(string[]) MemberMap
When reading, is used to get the field at the index of the name if there was a header specified. It will look for the first name match in the order listed. When writing, sets the name of the field in the header record. The first name will be used.
Inherited from MemberMap
NameIndex(int) MemberMap<TClass, TMember>
When reading, is used to get the index of the name used when there are multiple names that are the same.
NameIndex(int) MemberMap
When reading, is used to get the index of the name used when there are multiple names that are the same.
Inherited from MemberMap
Optional() MemberMap<TClass, TMember>
Ignore the member when reading if no matching field name can be found.
Optional() MemberMap
Ignore the member when reading if no matching field name can be found.
Inherited from MemberMap
TypeConverter(ITypeConverter) MemberMap<TClass, TMember>
Specifies the TypeConverter(ITypeConverter) to use when converting the member to and from a CSV field.
TypeConverter(ITypeConverter) MemberMap
Specifies the TypeConverter(ITypeConverter) to use when converting the member to and from a CSV field.
Inherited from MemberMap
TypeConverter<TConverter>() MemberMap<TClass, TMember>
Specifies the TypeConverter(ITypeConverter) to use when converting the member to and from a CSV field.
TypeConverter<TConverter>() MemberMap
Specifies the TypeConverter(ITypeConverter) to use when converting the member to and from a CSV field.
Inherited from MemberMap
Validate(Validate, ValidateMessage) MemberMap<TClass, TMember>
Specifies an expression to be used to validate a field when reading along with specified exception message.
Validate(Validate, ValidateMessage) MemberMap
Specifies an expression to be used to validate a field when reading along with specified exception message.
Inherited from MemberMap
Validate(Validate) MemberMap<TClass, TMember>
Specifies an expression to be used to validate a field when reading.
Validate(Validate) MemberMap
Specifies an expression to be used to validate a field when reading.
Inherited from MemberMap