私がそれを正しく読んだ場合、あなたは実際にbyte[]を保存しようとしています byte[]なので、DBに送信できません。 マップされたエンティティではありません。
あなたはおそらく書きたいでしょう:
dl.Contents = new DownloadContent { Data = content };
db.session.SaveOrUpdate(dl); // content is wrong, since content is of type byte[]
また、Inverse()を指定しなかったため 、おそらくSaveOrUpdateが必要になります DownloadContent したがって、最初に:
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);