My given code has an error of type conversion:
byte?[] AibAttachment = null;
MemoryStream target = new MemoryStream();
file.InputStream.CopyTo(target);
AibAttachment = target.ToArray();
In above code AibAttachment = target.ToArray(); this line is throwing an error like "Cannot implicitly convert 'byte[]' to 'byte?[]'"
Please help me on this.
CodePudding user response:
Maybe you can do something like this:
AibAttachment = Array.ConvertAll(target.ToArray(), i => (byte?)i);