rugsdirect
rugsdirect

Reputation:

MVC using Linq to Entity w/ sql encryption

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.

Upvotes: 1

Views: 353

Answers (2)

Billy Logan
Billy Logan

Reputation: 2863

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

Upvotes: 1

Craig Stuntz
Craig Stuntz

Reputation: 126547

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).

Upvotes: 0

Related Questions