I am wondering if it it is possible to add SQL to the existing SaveChanges method.
In my model I have specified the fields I want to encrypt by adding a custom Encrypted attribute.
I found how to succesfully encrypt the data with the IDataProtectionProvider.
However, it is required that the data is encrypted using SQL's ENCRYPTBYPASSPHRASE() function.
The fieldtypes in my model are type of string (or int in some cases), I want to save them in my database as varbinary.
My question is whether it's possible to create a function that saves my entity to the db, with the needed ENCRYPTBYPASSPHRASE() function, based on the Encrypted attribute specified in the model.
Thanks in advance.