Skip to content

Support for DateOnly/TimeOnly for SQL Server #30109

New issue

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

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

Already on GitHub? # to your account

Merged
merged 9 commits into from
Jan 30, 2023
Merged

Conversation

roji
Copy link
Member

@roji roji commented Jan 21, 2023

Closes #24507

/cc @ErikEJ

@roji roji requested a review from a team January 21, 2023 20:34
@ErikEJ
Copy link
Contributor

ErikEJ commented Jan 23, 2023

This is escalating 😄

@roji
Copy link
Member Author

roji commented Jan 23, 2023

@ErikEJ yeah, a little bit... Though I guess that's what it means to have "full support" for these types in EF...

@@ -43,7 +44,8 @@ public SqlServerNetTopologySuiteTypeMappingSourcePlugin(NtsGeometryServices geom
|| (storeTypeName != null
&& _spatialStoreTypes.Contains(storeTypeName))
? (RelationalTypeMapping)Activator.CreateInstance(
typeof(SqlServerGeometryTypeMapping<>).MakeGenericType(clrType ?? typeof(Geometry)),
typeof(SqlServerGeometryTypeMapping<>).MakeGenericType(
clrType is null || clrType == typeof(SqlBytes) ? typeof(Geometry) : clrType),
Copy link
Member Author

Choose a reason for hiding this comment

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

@bricelam FYI

This is necessary since we now pass in both CLR type and store name when generating a query string, where before we were only passing in the store type (https://github.com/dotnet/efcore/pull/30109/files#diff-5ff1054f2cb8ec92738024ab01584a00d9f3ac89dd89a92e98489e5e4e486f94R65)

Copy link
Contributor

@ajcvickers ajcvickers left a comment

Choose a reason for hiding this comment

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

Looks good, but let's talk about scaffolding in the design meeting.

@roji roji merged commit 827c182 into dotnet:main Jan 30, 2023
@roji roji deleted the DateTimeOnly branch January 30, 2023 09:16
@davidhenley
Copy link

Thank you guys for all your hard work on this!

@roji
Copy link
Member Author

roji commented Jan 30, 2023

You're very welcome!

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support the new BCL DateOnly and TimeOnly structs for SQL Server
4 participants