I assign image object to zero byte, if image is not provided:
byte[] image = new byte[0];
but How can save it into database using Entity framework?
Since no image is assigned, why not let it as a null value? Just insert the new item in the database and leave the image field null.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.