Skip to content

Add support for .NET 6's DateOnly and TimeOnly in *TypeMapper #80

@CyberBotX

Description

@CyberBotX

Is your feature request related to a problem? Please describe.
I don't know if I'd consider it a problem or not, but with the release of .NET 6, they introduced the types DateOnly and TimeOnly, but FlatFiles does not appear to have a way to handle those yet on the *TypeMapper classes (SeparatedValueTypeMapper and FixedLengthTypeMapper).

Describe the solution you'd like
I'd like to see FlatFiles have support for the DateOnly and TimeOnly types of .NET 6, perhaps not just for the *TypeMapper classes but all throughout the library.

Describe alternatives you've considered
The only alternative I've considered is to convert those types to DateTime to use the existing support in FlatFiles for that type. This is a bit painful, though, especially in the case of a nullable DateOnly or TimeOnly since the null-coalesce operator cannot be used. I also considered adding an extension method for the *TypeMapper classes, but that seems to be hard to accomplish with how many methods are private to those classes and not wanting to repeat too much code that is already in the library itself.

Additional context
Since these types are .NET 6+ only, I do not know how easy it would be to support those alongside everything else.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions