1 year ago

#262036

test-img

johnsabre

How to or where is the reference of the db parameter to its database context column on a DB interceptor method?

The purpose is to intercept queries to and from the database where if a certain column is detected it would encrypt/decrypt the value, for example an SSN column. We're using EF6 with Devart MySQL. I've been able to use the method "ReaderExecuting" DB Interceptor of EF but stuck on what the basis to decide to do the encryption/decryption on the value of a parameter:

enter image description here

As you can see, the command text is there and the collection of parameters, but what should I need to configure in order to connect the parameter to the db context column? And maybe even get the custom attributes set for that column?

Followed this guide: https://learn.microsoft.com/en-us/aspnet/mvc/overview/getting-started/getting-started-with-ef-using-mvc/connection-resiliency-and-command-interception-with-the-entity-framework-in-an-asp-net-mvc-application

c#

database

encryption

entity-framework-6

devart

0 Answers

Your Answer

Accepted video resources