在db中存储图像并使用nhibernate映射它们 [英] storing images in db and map them with nhibernate

查看:60
本文介绍了在db中存储图像并使用nhibernate映射它们的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在db中存储图像并使用nhibernate映射它们

how to store images in db and map them with nhibernate

推荐答案

您可以使用等价的二进制类型映射二进制数据到代码中的byte []数组和数据库中的varbinary。如果加载许多包含二进制数据的对象或大型对象,这可能会导致性能问题,因为这些对象将保留在一级缓存中。 本文讨论了在这种情况下提高性能的技术。

You can map binary data using the binary type which equates to a byte[] array in code and a varbinary in the database. This may cause performance issues if you load a number of objects containing binary data or large objects because the objects will be kept in memory in the first level cache. This article discusses techniques to improve performance in this situation.

这篇关于在db中存储图像并使用nhibernate映射它们的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆