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

Add Complex Types to What's New in EF8 #4476

Merged
merged 6 commits into from
Sep 12, 2023
Merged

Add Complex Types to What's New in EF8 #4476

merged 6 commits into from
Sep 12, 2023

Conversation

ajcvickers
Copy link
Member

No description provided.

Copy link
Member

@roji roji left a comment

Choose a reason for hiding this comment

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

So also my comments on the blog post, most of which are probably relevant here too.

@bricelam
Copy link
Contributor

bricelam commented Sep 12, 2023

I wrote a section on the Math improvements in RC1 if you want to add it to this (and possibly the blog post) for tomorrow. (If not, I'll send a separate PR)


Enhancements to Math

Generic math interfaces were introduced in .NET 7. Concrete types like double and float implemented these interfaces adding new APIs mirroring the existing functionality of Math and MathF.

EF Core 8 translates calls to these generic math APIs in LINQ using providers' existing SQL translations for Math and MathF. This means you're now free to choose between calls either like Math.Sin or double.Sin in your EF queries.

We worked with the .NET team to add two new generic math methods in .NET 8 that are implemented on double and float. These are also translated to SQL in EF Core 8.

.NET SQL
DegreesToRadians RADIANS
RadiansToDegrees DEGREES

Finally, we worked with Eric Sink in the SQLitePCLRaw project to enable the SQLite math functions in their builds of the native SQLite library. This includes the native library you get by default when you install the EF Core SQLite provider. This enables several new SQL translations in LINQ.

.NET SQLite
DegreesToRadians radians
RadiansToDegrees degrees
Acos acos
Acosh acosh
Asin asin
Asinh asinh
Atan atan
Atan2 atan2
Atanh atanh
Ceiling ceiling
Cos cos
Cosh cosh
Exp exp
Floor floor
Log ln or log
Log2 log2
Log10 log10
Pow pow
Sign sign
Sin sin
Sinh sinh
Sqrt sqrt
Tan tan
Tanh tanh
Truncate trunc

@ajcvickers
Copy link
Member Author

@bricelam Thanks! I've added it here, but I'll leave the blog post focused on complex types.

Add Math
@ajcvickers ajcvickers merged commit 6c7dfdf into main Sep 12, 2023
5 checks passed
@ajcvickers ajcvickers deleted the 230819_Peacocks branch September 12, 2023 10:46
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.

4 participants