I am using Filehelpers to import my database from files. I am now working on the reverse process and am having trouble seeing how to create the records from my data objects.
All the examples I can find show going from file -> table -> file I am using interfaces with generics to convert. I use this one on the inbound conversion:
public interface IConvertCSVRecordToType<T> where T : SimpleBase
{
T ConvertCSVRecordToType();
}
and would like to use something like this for the outbound:
public interface IConvertTypeToCSVRecord<T> where T : SimpleBase, new()
{
void ConvertTypeToCSVRecord(T type);
}
I use this class to represent the CSV Records:
[DelimitedRecord(";"), IgnoreEmptyLines]
public class CSVRecordFormat : IConvertCSVRecordToType<Material>,
IConvertTypeToCSVRecord<Material>
I came across TransformToRecordAttribute in the Filehelpers documentation
TransformToRecordAttribute Class
With this attribute you can mark a method in the RecordClass that is the responsable of convert it to the specified.
Does anyone have an example that uses this attribute or an example of how to create a record set to get me in the right direction?