MVC 使用 Linq to Entity 和 sql 加密

发布于 2024-07-29 23:40:50 字数 210 浏览 12 评论 0原文

目前我正在使用 sql 加密,并希望通过 Linq 继续使用它。 我将所有 CRUD 存储过程连接到表,以便处理后端的加密/解密。 问题是我的数据库模型看到的是 varbinary(max) 字段类型,用于 sql 加密存储。 该表的检索 sp 进行解密,从而返回一个字符串值。 如何解决这个问题。 似乎模型需要识别一个字符串来代替 varbinary,但我不确定如何处理这个问题。 提前致谢。

Currently i am using sql encryption and would like to continue using it through Linq. I have all my CRUD stored proc's wired up to the table in order to handle the encryption/decryption on the backend. Problem is my database model see's a field type of varbinary(max) which is used for the sql encryption storage. The retrieval sp for this table does the decryption thus returning a string value. How does one get around this. Seems like the model needs to recognize a string in place of the varbinary but i am unsure of how to handle this.
Thanks in advance.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

心清如水 2024-08-05 23:40:50

那么将数据库模型中的表映射改为视图映射呢?

So change the table mapping to a view mapping in the database model?

天邊彩虹 2024-08-05 23:40:50

我突然想到一些选择:

  1. 手动编辑 ssdl。
  2. 创建一个视图并映射它(除了映射之外,您不需要实际使用它)。

Off the top of my head, some choices:

  1. Edit the ssdl manually.
  2. Make a view and map that (you don't need to actually use it for anything but mapping).
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文