2
Follows code:
byte[] image1 = ConvertTo.Bytes(Request.Files[0]);
byte[] image2 = null;
ctx
.Users
.Where(x => x.Id == 1)
.Update(x => new User()
{
ImageByte1 = image1,
ImageByte2 = image2
});
I use this one: http://entityframework-plus.net/
Only the problem if I define null
in ImageByte2
. Follows error:
Implicit conversion of data type nvarchar to varbinary(max) does not is allowed. Use the CONVERT function to execute this query
Now if I set ImageByte1
and ImageByte2
as null
, update normally or ImageByte1
and ImageByte2
other than null
also makes update.
Some solution?
@LINQ, yes, they are voidable
– Matheus Miranda
He no longer accepts
SqlBinary.Null
:/– Matheus Miranda
@LINQ, problem already solved by updating the latest version
1.7.9
– Matheus Miranda