Om jag läste det rätt försöker du faktiskt spara byte[] till DB, som inte kan fungera, eftersom byte[] är inte en mappad entitet.
Du vill förmodligen skriva:
dl.Contents = new DownloadContent { Data = content };
db.session.SaveOrUpdate(dl); // content is wrong, since content is of type byte[]
Dessutom, eftersom du inte angav en Inverse() , måste du förmodligen SaveOrUpdate DownloadContent först, därför:
Download dl = new Download { OutFileName = "Test", DoForward = true };
DownloadContent dlc = new DownloadContent { Data = content };
dl.Contents = dlc;
db.session.SaveOrUpdate(dlc);
db.session.SaveOrUpdate(dl);