title: Passing data between controller and view with strongly typed model
body: <p>I have a little bit of a problem with communicate between the controller and a view.</p>
  
  <p><strong>UploadFile</strong> (Class):</p>
  
  <pre><code>    public class UploadFile
      {
          public string OrignialFilePath { get; set; }
          public string FilteredFilePath { get; set; }
          public string Name { get; set; } 
  
          public UploadFile(string x, string y, string z)
          {
              OrignialFilePath = x;
              FilteredFilePath = y;
              Name = z;
          } 
      }
  </code></pre>
  
  <p><strong>Files</strong> (Class):</p>
  
  <pre><code> public class Files
  {
  
      public List&lt;UploadFile&gt; list { get; set; }
  
      public Files()
      {
          list = new List&lt;UploadFile&gt;();
      }
  }
  </code></pre>
  
  <p><strong>Controller:</strong> (I get files with HTTP POST to this controller)</p>
  
  <pre><code>  Files fileList = new Files();
          foreach (var file in Files)
          {
              UploadFile fu = new UploadFile(file.x, file.y, file.z); 
              fileList.list.Add(fu);
          }
  
          return RedirectToAction("Result");
  </code></pre>
  
  <p><strong>Result:</strong> (Strongly-typed view)</p>
  
  <pre><code>@model IEnumerable&lt;SelectorITSelectorIT.Models.Files&gt;
  
  @{
      ViewBag.Title = "Result";
  }
  
  &lt;h2&gt;SelectorIT - Result&lt;/h2&gt;
  
  &lt;p&gt;
      @Html.ActionLink("Create New", "Create")
  &lt;/p&gt;
  &lt;table&gt;
      &lt;tr&gt;
          &lt;th&gt;&lt;/th&gt;
      &lt;/tr&gt;
  
  @foreach ( var item in Model) {
      &lt;tr&gt;
          &lt;td&gt;
              @item.list  ?????
          &lt;/td&gt;
      &lt;/tr&gt;
  }
  
  &lt;/table&gt;
  </code></pre>
  
  <p>In the <code>foreach var item in model</code></p>
  
  <p>When i write <code>@item.list</code> i cant go to the files within some index of the list ( i have there UploadFile instance).</p>
  
  <p>I need in the <code>foreach</code> statement : <code>foreach var item in model.list</code> but it doesn't let me, how can i do it?</p>
  
  <p>My Main goal is to Simply display in a table details about each UploadFile in the list of the model("Files").</p>
  
  <p>How can i do it ? </p>