Handling BLOBs in Entity Framework 4.0 in a stream-fashion

戏子无情 提交于 2020-01-03 08:45:21

问题


Is it possible to handle (read and write) binary data to SQL Server using Entity Framework 4.0 using streams? (i.e.: not the whole content shipped in a byte array)

An example could be taken from Download and Upload images from SQL Server via ASP.Net MVC which illustrates the way to stream nicely data from SQL Server in an example available for ASP.NET MVC. However it requires direct access to the DB and I am curious whether this could be done using an ORM.


回答1:


Unfortunately, this is not supported in Entity Framework 4. You'll need to work directly with the database.

I can't see it happening anytime soon either, since an ORM that didn't materialise objects fully in memory would have a lot of complications.

James



来源:https://stackoverflow.com/questions/4784367/handling-blobs-in-entity-framework-4-0-in-a-stream-fashion

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