I'm trying to create a sample ASP.NET MVC application with a ViewModel and onion architecture - very simple online shop.
So as you suppose this shop has products, and each product should have one very small image and when user clicks on that product, he is redirected to a details page, and of course he should see a bigger image of the product.
AT first I thought, it's a simple application, I would (internet) links to the pictures in the database. But then I thought, ok what about when this image is erased from internet, my product will no longer have an image.
So I should store those pictures in the database somehow. I have heard about something called FileStream that is the right way but I found no material to understand what is that.
I hope someone would help me.
SqlFileStreamclass, but there are issues with using that directly. I once found code that streamed files directly from the database to theHttpContext.Current.Response.OutputStream. The result was that a database connection was held open as long as the client was streaming the file, which in this case was a 40mb video file. Thus the average life time of this connection could be measured in minutes.