Invoke native SQL Server function from Entity Framework Core

asp.net-core c# entity-framework entity-framework-core sql-server

Question

Entity Framework 6 had a way to register SQL Server Built-in Function with [DbFunction] attribute or SQLFunctions class. Initially, as I understand, EF Core did not have this capability; but it seems from here that it now exists via EF.Functions. However, I can't find any place that describes how to use it. Do I decorate implementation with an attribute and code fallback? Do I call the function in my code? Specifically, I want to call SQL Server SOUNDEX() function, but I am sure there are many other examples.

1
6
4/29/2017 11:48:59 PM

Popular Answer

This functionality was added in EF Core 2.0

See the section Database scalar function mapping here - https://docs.microsoft.com/en-us/ef/core/what-is-new/

2
12/19/2017 4:08:32 AM


Related Questions





Related

Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow