简体   繁体   中英

How can I add byte[0] into image data field using Entity framework

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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM