Storing images with LINQ to SQL: Converting byte array or stream to Binary

前端 未结 1 866
一向
一向 2021-01-12 09:56

I am working with LINQ to SQL and my image fields are treated as Binary. It\'s no big issue to convert the Binary type to byte[] (you can just use the ToArray() method of t

相关标签:
1条回答
  • 2021-01-12 10:32

    You can use the constructor:

    public Binary(byte[] value)
    

    like this:

    yourObj.BinaryProperty = new Binary(bytes);
    
    0 讨论(0)
提交回复
热议问题