I want to save image into database. I have a Customer model that has Image property in it. I am creating a class that handle all the customer related database operations. In that class I have a method that takes in Customer object and inserts it into the database. Therefore, I have only Customer object to work with. How can I convert that Image object into byte array so that I can insert it into the datbase?
I know how to extract byte array from a file object. Should I change the customer model to contain image file instead of image object?