Persisting Blob Streams with NHibernate

主宰稳场 提交于 2019-12-03 03:07:43
Sebastian Markbåge

You could use a Stream using a custom type and map it according to your storage needs. But there are some issues with using the Stream object as I mention in my blog series about lazy streaming of BLOBs and CLOBs with NHibernate.

What you really need is a Blob object that in turn can create a Stream to read data from. Since Stream contains information about the position you're reading from and expects to be closed and disposed of it can create some issues when used directly in a domain model.

I would suggest that you take a look at the blog series as well as the source code of the NHibernate.Lob project. It includes various mapping options for just such a problem. A little scarcely documented so far but more is coming.

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