Subsonic SimpleRepository upload image

177 views Asked by At

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")
1

There are 1 answers

0
stoic On BEST ANSWER

Found the answer on github, they fixed this issue in one of their later releases: http://github.com/inbox/555338#reply