public sealed class CsvMapping : DynamicObject,
IEnumerable<DynamicProperty>, IEnumerable, ICloneable
Public NotInheritable Class CsvMapping
Inherits DynamicObject
Implements IEnumerable(Of DynamicProperty), IEnumerable,
ICloneable
public ref class CsvMapping sealed : public DynamicObject,
IEnumerable<DynamicProperty^>, IEnumerable, ICloneable
[<SealedAttribute>]
type CsvMapping =
class
inherit DynamicObject
interface IEnumerable<DynamicProperty>
interface IEnumerable
interface ICloneable
end
Use CsvMappingBuilder to create an instance.
The class allows you to index the data of the CsvRecord object in a sequence of your choice, to access the data with .NET properties dynamically implemented at runtime ("late binding"), and to perform type conversions automatically. In order to be able to use the dynamic properties of the CsvMapping class like regular .NET properties, the CsvMapping instance has to be assigned to a variable that is declared with the keyword dynamic.
Use the methods of the CsvConverter class or the corresponding extension methods to perform read and write operations with the CsvMapping.
In order to support high-performance scenarios, the DynamicProperty instances of the CsvMapping alternatively can be accessed directly without having to use dynamic .NET properties:
With this approach boxing and unboxing of value types can be avoided.
Unfortunately, for dynamic properties, the compiler does not monitor the nullability of reference types. With the high-performance approach just presented this can be avoided, but a critical point here is the correct type cast with the AsITypedPropertyT(DynamicProperty) method: Make sure that you choose the correct nullability of the reference types here. The compiler can't check this.
Count | Gets the number of DynamicProperty instances in the CsvMapping. |
ItemInt32 | Gets the DynamicProperty with the specified index. |
ItemString | Gets the DynamicProperty with the specified PropertyName. |
PropertyNames | Returns the property names, which are currently registered in the CsvMapping. |
Record | Gets or sets the CsvRecord instance whose data is accessed with dynamic properties. |
RegexTimeout | Maximum time (in milliseconds) that can be used to resolve a CSV column name alias. |
Clone | Creates a new object that is a copy of the current instance. |
Contains | Examines whether a DynamicProperty instance is registered in the CsvMapping under the name that is specified with propertyName. |
Equals | Determines whether the specified object is equal to the current object. (Inherited from Object) |
GetEnumerator | Returns an enumerator that iterates through the collection. |
GetHashCode | Serves as the default hash function. (Inherited from Object) |
GetType | Gets the Type of the current instance. (Inherited from Object) |
ToString | Returns a string that represents the current object. (Overrides ObjectToString) |
SaveCsvDynamicProperty |
Saves a collection of TSource instances as a CSV file
with header row.
(Defined by CsvConverterExtension) |
SaveCsvDynamicProperty |
Saves a collection of TSource instances as a CSV file
without header row.
(Defined by CsvConverterExtension) |
SaveCsvDynamicProperty |
Saves a collection of TSource instances as a CSV file
with header row.
(Defined by CsvConverterExtension) |
SaveCsvDynamicProperty |
Saves a collection of TSource instances as a CSV file
without header row.
(Defined by CsvConverterExtension) |
ToCsvDynamicProperty |
Converts a collection of TSource instances to a CSV
String with header row.
(Defined by CsvConverterExtension) |
ToCsvDynamicProperty |
Converts a collection of TSource instances to a CSV
String without a header row.
(Defined by CsvConverterExtension) |
ToCsvDynamicProperty |
Converts a collection of TSource instances to a CSV
String with header row.
(Defined by CsvConverterExtension) |
ToCsvDynamicProperty |
Converts a collection of TSource instances to a CSV
String without a header row.
(Defined by CsvConverterExtension) |
IEnumerableGetEnumerator | Returns an enumerator that iterates through a collection. |