Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MSSQL] Add DateTimeOffset members mapping #1810

Merged
merged 2 commits into from
Jul 15, 2019
Merged

[MSSQL] Add DateTimeOffset members mapping #1810

merged 2 commits into from
Jul 15, 2019

Conversation

MaceWindu
Copy link
Contributor

@MaceWindu MaceWindu commented Jul 13, 2019

Fixes #1666

  • Adds mapping to SQL for most of DateTimeOffset type members:
    • Year
    • Month
    • DayOfyear
    • Day
    • DayOfWeek
    • Hour
    • Minute
    • Second
    • Millisecond
    • Date
    • TimeOfDay
    • AddYears()
    • AddMonths()
    • AddDays()
    • AddHours()
    • AddMinutes()
    • AddSeconds()
    • AddMilliseconds()
  • fixes SQL, generated for Add_interval_ methods for Oracle to preserve source value type

Those mappings should be be used only for SQL Server 2008+. For other databases it could work in some cases, but in general it is not supported (and hardly ever be supported) due to:

  • lack of datetime type with offset on database side
  • different logic implemented in .net for DateTimeOffset type and in database for DataTimeOffset-like type

@MaceWindu MaceWindu added this to the 2.8.0 milestone Jul 13, 2019
@@ -0,0 +1,83 @@
using System;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bad name of the file

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

busted...

Copy link
Member

@sdanyliv sdanyliv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With right file name.

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

Successfully merging this pull request may close these issues.

DateTimeOffset.Date is translated incorrectly
2 participants