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

前端 未结 1 863
一向
一向 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)
提交回复
热议问题