I am using IDataProtector to encrypt my data before storing into the database. All strings work fine for example:
LastName = _protector.Protect(student.LastName)
However I can't use Protect with:
public DateTime EnrollmentDate { get; set; }
Using:
Student nstudent = new Student
{
LastName = _protector.Protect(student.LastName),
EnrollmentDate = _protector.Protect(student.EnrollmentDate)
};
I get this error:
cannot convert from 'System.DateTime' to 'byte[]'