title: How to show images from a folder using Razor MVC?
body: <p>I am using Razor MVC and I would like to show images from "~/Content/uploads" folder.
  I came up with the following solution:</p>
  
  <pre><code>@foreach (FileInfo fileInfo in (new DirectoryInfo(Server.MapPath("~/Content/uploads"))
                                      .GetFiles().Where(x =&gt; x.Extension == ".jpg"))) {
      &lt;img src="/@fileInfo
                 .FullName
                 .Substring(Server.MapPath("~/").Length)
                 .Replace("\\", "/")"
           width="100"&gt;
  }
  </code></pre>
  
  <p>The problem with the code is that I am taking the full file path
  and I am removing the Server.MapPath() prefix.</p>
  
  <p>How can I simplify this code?</p>