I’m developing a web-based store in MVC (very closely based on the SportsStore example in Pro ASP.Net MVC 3 Framework http://www.powells.com/biblio/61-9781430234043-0).
I’m using a SQL database and accessing it through System.Data.Entity.DbContext
I have a table that describes the products that I’m selling, with columns for name, description, price – this seems to work fine.
However, I also want to include images. I’ll probably have between 3 and 6 images per product that are about ~150KB each.
I think it would be convenient to store these images as binary data into another table in the database and include a column that identifies which product they’re related to. This should work but it seems inelegant – do you have a better suggestion?
I’d really like to keep the images in the database, that seems easier than storing paths to images in the database and separately uploading the images to a webserver.