I currently have a Hex value but it has an odd length. I used a file to byte[] code and it both produced an odd character length of a hex. After the value is in the Database, I copy the Hex value because I need that for a migration to apply to a bunch of other databases. I can't convert Hex to Byte[] because of the odd length. Any suggestions to jump over this hurdle? Is there a Hex to Byte[] converter that can handle odd number of lengths?
Encoder one
var fileStream = new FileStream(openFileDialog.FileName, FileMode.Open, FileAccess.Read);
var bytes = new byte[fileStream.Length];
fileStream.Read(bytes, 0, Convert.ToInt32(fileStream.Length));
fileStream.Close();
UnitOfWork.FileRepository.Add(new ObjectModel.File.File
{
FileArray = bytes,
FileName = Path.GetFileName(openFileDialog.FileName),
FileExtension = Path.GetExtension(openFileDialog.FileName),
/InteractionId = _interaction.Id,
);
UnitOfWork.Save(User.Id);