I've got a .NET MVC app where I need to display a list of images with some text. The images and text are stored in the database in the same table, and returned in my simple model. What I haven't figured out is how to display all of these images without hitting the database again for every single image.
I see several examples, such as:
- ASP.NET MVC: loading images from database and displaying their in view
- Problem with displaying image from DB using asp.net MVC 2
and others, but they all go back to the database for every image. That doesn't make sense, because there could be dozens of images, and I don't want to keep making single calls to the database when I already have the image data returned in my model.
I'm new to ASP.NET MVC, (and also never worked with images stored in a DB before) and I think I am just missing something, and that it can't be this difficult. If anyone has solved this, I'd love to hear it, and I think others would too, based on the other questions already here.