Skip to content

Instantly share code, notes, and snippets.

@JohannesSundqvist
Created October 3, 2016 09:41
Show Gist options
  • Save JohannesSundqvist/cd97f5272f21eaf87b43609dbbda2c82 to your computer and use it in GitHub Desktop.
Save JohannesSundqvist/cd97f5272f21eaf87b43609dbbda2c82 to your computer and use it in GitHub Desktop.
Expected:
Image1.jpg
Image2.jpg
Actual:
Image1.jpg
public IActionResult ViewSpecificCustomer([Bind(Prefix = "id")]string code) {
// Directory currently contains 2 images that both gets selected (seen through debugging and placing breakpoints)
if (Directory.GetFiles(_environment.WebRootPath + @"\Images\CustomerImages\").Length != 0)
{
foreach (var item in Directory.GetFiles(_environment.WebRootPath + @"\Images\CustomerImages\", code + "*.*"))
{
ViewData["GetImages"] = item.Replace(_environment.WebRootPath, "");
}
}
return View();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment