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

Syntax

public abstract class ClassMap<TClass> : ClassMap

Type Parameters

Name Description
TClass The System.Type of class to map.

Constructors

Name Summary
ClassMap() Creates an instance of ClassMap<TClass>.

Properties

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

Methods

Name Return Value Summary
ApplyAttributes(MemberMap) void
Applies attribute configurations to the map.
Inherited from ClassMap
ApplyAttributes(MemberReferenceMap) void
Applies attribute configurations to the map.
Inherited from ClassMap
ApplyAttributes(ParameterMap) void
Applies attribute configurations to the map.
Inherited from ClassMap
ApplyAttributes(ParameterReferenceMap) void
Applies attribute configurations to the map.
Inherited from ClassMap
AutoMap(CsvConfiguration) void
Auto maps all members for the given type. If a member is mapped again it will override the existing map.
Inherited from ClassMap
AutoMap(CsvContext) void
Auto maps all members for the given type. If a member is mapped again it will override the existing map.
Inherited from ClassMap
AutoMap(CultureInfo) void
Auto maps all members for the given type. If a member is mapped again it will override the existing map.
Inherited from ClassMap
AutoMapConstructorParameters(ClassMap, CsvContext, LinkedList<Type>, int) void
Auto maps the given map using constructor parameters.
Inherited from ClassMap
AutoMapMembers(ClassMap, CsvContext, LinkedList<Type>, int) void
Auto maps the given map and checks for circular references as it goes.
Inherited from ClassMap
CheckForCircularReference(Type, LinkedList<Type>) bool
Checks for circular references.
Inherited from ClassMap
GetGenericType() Type
Gets the generic type for this class map.
Inherited from ClassMap
GetMaxIndex(bool) int
Get the largest index for the members and references.
Inherited from ClassMap
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.
Inherited from ClassMap
Map(Type, MemberInfo, bool) MemberMap
Maps a member to a CSV field.
Inherited from ClassMap
Map<T>(Expression<Func<T, object>>, bool) MemberMap
Maps a member to a CSV field.
Map<TMember>(Expression<Func<TClass, TMember>>, bool) MemberMap<TClass, TMember>
Maps a member to a CSV field.
Parameter(ConstructorInfo, ParameterInfo) ParameterMap
Maps a constructor parameter to a CSV field.
Inherited from ClassMap
Parameter(Func<ConstructorInfo>, string) ParameterMap
Maps a constructor parameter to a CSV field.
Inherited from ClassMap
Parameter(string) ParameterMap
Maps a constructor parameter to a CSV field.
Inherited from ClassMap
References(Type, MemberInfo, object[]) MemberReferenceMap
Maps a member to another class map.
Inherited from ClassMap
References<TClassMap>(Expression<Func<TClass, object>>, object[]) MemberReferenceMap
Meant for internal use only. Maps a member to another class map. When this is used, accessing a property through sub-property mapping later won't work. You can only use one or the other. When using this, ConvertUsing will also not work.
ReIndex(int) int
Resets the indexes based on the given start index.
Inherited from ClassMap