ClassMap Class
Maps class members to CSV fields.
Namespace
CsvHelper.Configuration
Base Types
  • object
Derived Types
graph BT Type-->Base0["object"] Type["ClassMap"] class Type type-node Derived0["ClassMap<TClass>"]-->Type click Derived0 "/CsvHelper/api/CsvHelper.Configuration/ClassMap_1"

Syntax

public abstract class ClassMap

Properties

Name Property Type Summary
ClassType Type
The type of the class this map is for.
MemberMaps MemberMapCollection
The class member mappings.
ParameterMaps List<ParameterMap>
The class constructor parameter mappings.
ReferenceMaps MemberReferenceMapCollection
The class member reference mappings.

Methods

Name Return Value Summary
ApplyAttributes(MemberMap) void
Applies attribute configurations to the map.
ApplyAttributes(MemberReferenceMap) void
Applies attribute configurations to the map.
ApplyAttributes(ParameterMap) void
Applies attribute configurations to the map.
ApplyAttributes(ParameterReferenceMap) void
Applies attribute configurations to the map.
AutoMap(CsvConfiguration) void
Auto maps all members for the given type. If a member is mapped again it will override the existing map.
AutoMap(CsvContext) void
Auto maps all members for the given type. If a member is mapped again it will override the existing map.
AutoMap(CultureInfo) void
Auto maps all members for the given type. If a member is mapped again it will override the existing map.
AutoMapConstructorParameters(ClassMap, CsvContext, LinkedList<Type>, int) void
Auto maps the given map using constructor parameters.
AutoMapMembers(ClassMap, CsvContext, LinkedList<Type>, int) void
Auto maps the given map and checks for circular references as it goes.
CheckForCircularReference(Type, LinkedList<Type>) bool
Checks for circular references.
GetGenericType() Type
Gets the generic type for this class map.
GetMaxIndex(bool) int
Get the largest index for the members and references.
Map() MemberMap<object, object>
Maps a non-member to a CSV field. This allows for writing data that isn't mapped to a class member.
Map(Type, MemberInfo, bool) MemberMap
Maps a member to a CSV field.
Parameter(ConstructorInfo, ParameterInfo) ParameterMap
Maps a constructor parameter to a CSV field.
Parameter(Func<ConstructorInfo>, string) ParameterMap
Maps a constructor parameter to a CSV field.
Parameter(string) ParameterMap
Maps a constructor parameter to a CSV field.
References(Type, MemberInfo, object[]) MemberReferenceMap
Maps a member to another class map.
ReIndex(int) int
Resets the indexes based on the given start index.