title: pass linq query to view
body: <p>I made a linq query which i want to pass to the view but it's giving me this error</p>
  
  <pre><code>The model item passed into the dictionary is of type 'System.Data.Entity.Infrastructure.DbQuery`1[&lt;&gt;f__AnonymousType4`2[System.String,System.String]]', but this dictionary requires a model item of type 'System.Collections.Generic.IEnumerable`1
  </code></pre>
  
  <p>My ViewModel</p>
  
  <pre><code>  public class ManageScoreViewModel
       {
           public string fullName { get; set; }
           public string teamName { get; set; }
       }
  </code></pre>
  
  <p>Controller</p>
  
  <pre><code>  public ActionResult Index()
          {
              MyteamViewModel ms = new MyteamViewModel ();
              var vm = (from u in db.Users
                       join tm in db.Team_Members
                       on u.user_id equals tm.user_id
                       join t in db.Teams
                       on tm.team_id equals t.team_id
                       orderby t.name
                       select new { fullName = u.firstName + u.lastName, teamName = t.name });
            //  var vmlist = vm.ToList();
  
              return View(vm);
          }
  </code></pre>
  
  <p>The view is type IEnumerable</p>
  
  <pre><code>@model IEnumerable&lt;CTA2._0.ViewModels.ManageScoreViewModel&gt;
  @foreach (var item in Model)
  {
      &lt;tr&gt;
          &lt;td&gt;
              @Html.DisplayFor(modelItem =&gt; item.fullName)
          &lt;/td&gt;
          &lt;td&gt;
              @Html.DisplayFor(modelItem =&gt; item.teamName)
          &lt;/td&gt;
  </code></pre>
  
  <p>I tried converting the query to a list(var vmlist = vm.ToList();). Didn't work. Any help would be appreciated.</p>