TypeConverterT Class

Abstract base class for type converters that convert between the content of a single field of CSV data and .NET data types.

Definition

Namespace: FolkerKinzel.CsvTools.Mappings.TypeConverters
Assembly: FolkerKinzel.CsvTools.Mappings (in FolkerKinzel.CsvTools.Mappings.dll) Version: 1.1.0+1263e8243dc2cd78095f678f813d7d9c52ea4315
C#
public abstract class TypeConverter<T> : ITypeConverter<T>
Inheritance
Object    TypeConverterT
Derived
More
Implements
ITypeConverterT

Type Parameters

T
The Type to convert.

Constructors

TypeConverterT Abstract base class for type converters that convert between the content of a single field of CSV data and .NET data types.

Properties

AcceptsNull Gets a value indicating whether the converter accepts null references as input.
DataType The data type the converter converts.
DefaultValue Gets the value to return if the parser finds no data in the CSV, or if parsing fails and the Throwing property is false.
Throwing Gets a value indicating whether the converter throws a FormatException when a parsing error occurs, or if it returns DefaultValue value instead.

Methods

ConvertToString Converts value to a String or null.
EqualsDetermines whether the specified object is equal to the current object.
(Inherited from Object)
FinalizeAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object)
GetHashCodeServes as the default hash function.
(Inherited from Object)
GetTypeGets the Type of the current instance.
(Inherited from Object)
MemberwiseCloneCreates a shallow copy of the current Object.
(Inherited from Object)
Parse Parses a read-only span of characters and returns the corresponding .NET object.
ToStringReturns a string that represents the current object.
(Inherited from Object)
TryParse Tries to parse a read-only span of characters as a T value.

Extension Methods

ToArrayConverterTItem Creates a new array converter instance.
(Defined by TypeConverterExtension)
ToDBNullConverterT Returns a TypeConverter<> instance that converts and accepts T as well as DBNull.Value. DBNull.Value is the DefaultValue of this TypeConverterT instance.
(Defined by TypeConverterExtension)
ToICollectionConverterTItem Creates a new ICollectionT converter instance.
(Defined by TypeConverterExtension)
ToIEnumerableConverterTItem Creates a new IEnumerableT converter instance.
(Defined by TypeConverterExtension)
ToIListConverterTItem Creates a new IListT converter instance.
(Defined by TypeConverterExtension)
ToIReadOnlyCollectionConverterTItem Creates a new IReadOnlyCollectionT converter instance.
(Defined by TypeConverterExtension)
ToIReadOnlyListConverterTItem Creates a new IReadOnlyListT converter instance.
(Defined by TypeConverterExtension)
ToListConverterTItem Creates a new ListT converter instance.
(Defined by TypeConverterExtension)
ToNullableConverterT Creates a new NullableT converter instance.
(Defined by TypeConverterExtension)
ToReadOnlyCollectionConverterTItem Creates a new ReadOnlyCollectionT converter instance.
(Defined by TypeConverterExtension)

See Also