Closed JimF42 closed 1 year ago
Applied fix, pushed new version v1.2.1.58
Just tried it out, works great. Thanks for the quick turnaround.
Reader works fine (I didn't try the Lite version), but ChoCSVWriter
doesn't seem to be firing it either.
ChoCSVWriter works for me. Can't reproduce it.
Lite version, doesn't use converters, other features. It is simple reader, return values as text only.
I have an extremely simple example attached. In my normal program, my input class and output class would be different structures.
The output is in the \bin\debug\net7.0
folder after you run it.
ChoEtlSample.zip
You need to decorate each field with ChoCSVRecordField
to pick up the converter by the framework.
internal class IpAddressRecordOut
{
[ChoCSVRecordField]
public string? Description { get; set; }
[ChoCSVRecordField]
[ChoTypeConverter(typeof(IpAddressTypeConverter))]
public IPAddress? IPAddress { get; set; }
}
May be in future, will consider taking the converter without the field attribute.
OK. Thank you for your patience with me on this.
Enclosed is a sample project where I need to read in an IPAddress from a CSV and put it into a IPAddress data type. I added a
IChoValueConverter
class and decorated the property withChoTypeConverter(typeof(IpAddressTypeConverter))
. It doesn't appear to be called (I addedConsole.WriteLine
andSystem.Diagnostics.Debug.WriteLine
statements, and nothing is showing up--all IP Addresses are null.If, as a test, I use the fluent approach, it works fine (also in the sample).
FYI, in your documentation, 8.3 Type Converters, you mention
IChoTypeConverter
, but I can't find that and usedIChoValueConverter
instead. Maybe that's my problem??