Notes: I added a new abstract TypeConverterGeneric class to make it easier to create generic type converters.
This is not necessary to fix the issue, but makes it a easier to write generic type converter factories (as can be seen in test).
Please have a look at System.Text.Json.Serialization.JsonConverter (and JsonConverterFactory) which has this and is a quite useful API. I recommend to rename TypeConverterGeneric<T> to TypeConverter<T> to make it consistent (see again JsonConverter) but this name is already taken without <T> for something different. I will add another commit to solve this but of course this is a (minor) breaking change as current TypeConverter is public (but probably not used by anyone). Please feel free to edit/cherry pick.
Let me know if there is anything I can do getting this merged.
See https://github.com/JoshClose/CsvHelper/issues/2153
Notes: I added a new abstract TypeConverterGeneric class to make it easier to create generic type converters.
This is not necessary to fix the issue, but makes it a easier to write generic type converter factories (as can be seen in test).
Please have a look at System.Text.Json.Serialization.JsonConverter (and JsonConverterFactory) which has this and is a quite useful API. I recommend to rename
TypeConverterGeneric<T>
toTypeConverter<T>
to make it consistent (see againJsonConverter
) but this name is already taken without<T>
for something different. I will add another commit to solve this but of course this is a (minor) breaking change as currentTypeConverter
is public (but probably not used by anyone). Please feel free to edit/cherry pick.Let me know if there is anything I can do getting this merged.