MVC使用Linq实体w / sql加密

时间:2021-01-17 02:15:45

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.

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

2 个解决方案

#1


1  

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

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

#2


0  

Off the top of my head, some choices:

在我的头顶,一些选择:

  1. Edit the ssdl manually.
  2. 手动编辑ssdl。

  3. Make a view and map that (you don't need to actually use it for anything but mapping).
  4. 制作一个视图并映射(除了映射之外,您不需要实际使用它)。

#1


1  

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

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

#2


0  

Off the top of my head, some choices:

在我的头顶,一些选择:

  1. Edit the ssdl manually.
  2. 手动编辑ssdl。

  3. Make a view and map that (you don't need to actually use it for anything but mapping).
  4. 制作一个视图并映射(除了映射之外,您不需要实际使用它)。