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

Support for DateOnly/TimeOnly for SQL Server #30109

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
Member

@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!

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.

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