Use Entity Framework in CLR Stored procedure

我与影子孤独终老i 提交于 2019-12-24 09:28:02

问题


I found a post from seven or so years ago that the Entity Framework could not be used in a CLR stored procedure. Has this been rectified in the past seven or so years? Is an update available that will allow the Entity Framework to work in a CLR stored procedure?


回答1:


The normal reason you don't do this is that if you did, you would have to install all of .NET Framework assemblies that EF depends on into the database as unsafe assemblies, and you would have to update them every time the .NET Framework on the server was updated. As of EF 6.2 that list is :

smdiagnostics.dll
system.runtime.serialization.dll
system.dynamic.dll
microsoft.csharp.dll

This is in addition to installing updated versions of

entityframework.dll  
entityframework.sqlserver.dll

Which would come along with updated versions of your custom CLR dll.

And then you would have to start testing EF in SQL CLR to determine if it a) works and b) plays nicely in SQLCLR's unique hosting environment.



来源:https://stackoverflow.com/questions/48284609/use-entity-framework-in-clr-stored-procedure

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!