Quantcast
Channel: ASP.NET Core
Viewing all articles
Browse latest Browse all 9386

Display all images from database

$
0
0

Hi folks,

Here is my code as below:

[HttpGet("Download/{id}")]
public FileStreamResult ([FromRoute] int id)
{
    var getFile = _context.UploadPoliceReports.FirstOrDefault(m => m.UserVehicleID == id);
    //var getFile = _context.UploadPoliceReports.where(m => m.UserVehicleID == id);

    MemoryStream ms = new MemoryStream(getFile.Data);
    return new FileStreamResult(ms, getFile.ContentType);
}

I am getting only one image file (Dino11.jpg) and it seems good.
Now I want to display all images (Dino11 and Dino22)  from database where UserVehicleID has two same ID with different images.


Any idea?
I am waiting for your response.

Thanks in advance!


Viewing all articles
Browse latest Browse all 9386

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>