Skip to content

Adresses issue 534#540

Open
EfimC-Work wants to merge 2 commits intojonwagner:mainfrom
EfimC-Work:issue-534
Open

Adresses issue 534#540
EfimC-Work wants to merge 2 commits intojonwagner:mainfrom
EfimC-Work:issue-534

Conversation

@EfimC-Work
Copy link

Summary

Implements support for .NET 6+ DateOnly and TimeOnly types, resolving issue #534.

Changes

  • Maps DateOnly to DbType.Date (SQL Server DATE column)
  • Maps TimeOnly to DbType.Time (SQL Server TIME column)
  • Adds proper serialization/deserialization support
  • Includes bidirectional type conversions
  • Maintains backward compatibility with .NET Framework 4.8 and .NET Standard 2.0

Files Modified

  • Core type mapping and conversion logic
  • SQL Server provider adapters
  • Test cases for DateOnly/TimeOnly

Testing

  • All functioning existing tests pass
  • New tests added for DateOnly and TimeOnly types
  • Build successful for all target frameworks (net8.0, netstandard2.0, net48)

Backward Compatibility

Uses #if NET6_0_OR_GREATER conditional compilation to maintain compatibility with older frameworks.
Ensured that casts to TimeSpan and DateTime still work.

Build Verification

All changes have been verified to compile successfully

Adds support for .NET 6 DateOnly and TimeOnly types to parameter binding and deserialization.
@EfimC-Work
Copy link
Author

Third try had a typo in the branch name and could not verify all tests yesterday on my macbook. I think now everything should work as intended

@jonwagner
Copy link
Owner

Awesome. I will do a review this week.

And since I work off a macbook as well, my position is that I will build Windows-only/old versions but I won't verify them if there are low-risk changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants