Subsonic SimpleRepository 上传图片
我已经使用 SimpleRepository 几个月了,第一次我必须在数据库中上传和存储图像/文档
我的类如下所示:
public class Document: ObjectMetaData
{
public string FileName { get; set; }
public Guid UserId { get; set; }
public DocumentType DocumentType { get; set; }
public string DocumentLocation { get; set; }
public byte[] DocumentData { get; set; }
}
public enum DocumentType
{
EmploymentContractSigned = 1,
EmploymentContractUnSigned = 2
}
当我将数据保存到数据库时,亚音速只是忽略“DocumentData”
如何然后我将文件保存到数据库吗?
- DocumantData = File.ReadAllBytes("somefile.doc")
I have been using SimpleRepository for months now, and for the first time i have to upload and store an Image/Document in the database
My Class looks as follow:
public class Document: ObjectMetaData
{
public string FileName { get; set; }
public Guid UserId { get; set; }
public DocumentType DocumentType { get; set; }
public string DocumentLocation { get; set; }
public byte[] DocumentData { get; set; }
}
public enum DocumentType
{
EmploymentContractSigned = 1,
EmploymentContractUnSigned = 2
}
When i persist the data to the db, subsonic just ignore's the "DocumentData"
how do i save the file to db then?
- DocumantData = File.ReadAllBytes("somefile.doc")
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在 github 上找到了答案,他们在后续版本之一中解决了这个问题: http://github.com /inbox/555338#reply
Found the answer on github, they fixed this issue in one of their later releases: http://github.com/inbox/555338#reply