CsvSerializer<TTargetType> class

Used to serialize a TargetType object to a CSV file.

public class CsvSerializer<TTargetType> : TextSerializer<TTargetType>
    where TTargetType : new()
parameter description
TTargetType The type of object that will be serialized. TargetType either must have the TextSerializable attribute applied, and any fields contained must have the TextField attribute applied to them, or Fluent Configuration must be used.

Public Members

name description
CsvSerializer() Initializes a new instance of the CSVSerializer class with default values, using Attributes on the target type to determine the configuration of fields and properties.
CsvSerializer(…) Initializes a new instance of the CSVSerializer class with specific values for how the CSV should be formatted, using Attributes on the target type to determine the configuration of fields and properties. (2 constructors)
AlwaysWriteQualifier { get; set; } True if should wrap every field in the Qualifier during serialization. If false, then the qualifier is only written if the field contains the Delimiter.
Delimiter { get; set; } Character which is used to delimit fields in the record.
Qualifier { get; set; } Character used to wrap a field if the field contins the Delimiter.
DeserializeArray(…) Creates a collection of TargetType objects from a stream of text containing CSV. (2 methods)
DeserializeEnumerable(…) Deserializes a CSV file one record at a time suitable for usage in a foreach loop.
SerializeArray(…) Serializes an array of objects to CSV Format
SerializeHeader() Serializes out the header row by itself

Protected Members

name description
override FormatOutput(…) Write out a list of fields in CSV format.
override GetFieldFromAttribute(…) Used by a derived class to return a Field configuration specific to this serializer back for a given method based on the attributes applied.
override Parse(…) Parses a line of text as a record and returns the fields.

See Also