Skip to content

Support for DateOnly/TimeOnly for SQL Server - #30109

Merged
roji merged 9 commits into
dotnet:mainfrom
roji:DateTimeOnly
Jan 30, 2023
Merged

Support for DateOnly/TimeOnly for SQL Server#30109
roji merged 9 commits into
dotnet:mainfrom
roji:DateTimeOnly

Conversation

@roji

@roji roji commented Jan 21, 2023

Copy link
Copy Markdown
Member

Closes #24507

/cc @ErikEJ

@roji
roji requested a review from a team January 21, 2023 20:34
Comment thread src/EFCore.SqlServer/Storage/Internal/SqlServerTypeMappingSource.cs
Comment thread src/EFCore.SqlServer/Storage/Internal/SqlServerTypeMappingSource.cs
Comment thread src/EFCore.SqlServer/Storage/Internal/SqlServerTypeMappingSource.cs
@ErikEJ

ErikEJ commented Jan 23, 2023

Copy link
Copy Markdown
Contributor

This is escalating 😄

@roji

roji commented Jan 23, 2023

Copy link
Copy Markdown
Member Author

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

? (RelationalTypeMapping)Activator.CreateInstance(
typeof(SqlServerGeometryTypeMapping<>).MakeGenericType(clrType ?? typeof(Geometry)),
typeof(SqlServerGeometryTypeMapping<>).MakeGenericType(
clrType is null || clrType == typeof(SqlBytes) ? typeof(Geometry) : clrType),

Copy link
Copy Markdown
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)

Comment thread src/EFCore.SqlServer/Extensions/SqlServerDbFunctionsExtensions.cs Outdated
Comment thread src/EFCore.SqlServer/Extensions/SqlServerDbFunctionsExtensions.cs Outdated

@ajcvickers ajcvickers left a comment

Copy link
Copy Markdown
Contributor

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
Copy Markdown

Thank you guys for all your hard work on this!

@roji

roji commented Jan 30, 2023

Copy link
Copy Markdown
Member Author

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