vendredi 2 juin 2017

encryption class and List

Let's say we have a data object, Patient, and we are binding a List<Patient> to a UI widget.

public class Patient
{
    public Patient(){}
    public string Name {get;set;}
    public string MedicalNotes {get;set;}
}

We want to encrypt the contents of the MedicalNotes property before writing the record to the database (assume we are a small company and cannot afford the license fee of the SQL database that offers the transparent encryption feature) and decrypt the column's contents before it gets bound to the UI widget.

Do we instantiate a singleton Crypto class and feed a reference to it to the Patient constructor, so that each Patient object in the List can invoke the encryption object's methods?

Aucun commentaire:

Enregistrer un commentaire