title: Convert System.Linq.IQueryable to System.Collections.Generic.ICollection
body: <p>I'm new to asp.net mvc &amp; I'm trying to make a website with asp.net mvc 4 &amp; EF6 where user can sort a table after login. I'm getting a compile error saying <code>Cannot implicitly convert type System.Linq.IQueryable to System.Collections.Generic.ICollection</code>. My codes are below,</p>
  
  <p><strong>Controller</strong></p>
  
  <pre><code>public ActionResult Login(string sortOrder)
      {
          if (Session["UserNAME"] != null)
          {
              ViewBag.CodeSort = String.IsNullOrEmpty(sortOrder) ? "code_desc" : "";
              var sortedOut = new MkistatVsUserLogin { mkistats = dsedb.mkistats.AsQueryable() };     //Error in this line
  
              switch (sortOrder)
              {
                  case "code_desc":
                      sortedOut = sortedOut.OrderByDescending(s =&gt; s.MKISTAT_CODE);
                      break;
                  default:
                      sortedOut = sortedOut.OrderBy(s =&gt; s.MKISTAT_CODE);
                      break;
              }
              return View(sortedOut.ToList());
          }
          else
          {
              return RedirectToAction("Home");
          }
      }
  </code></pre>
  
  <p><strong>Model</strong></p>
  
  <pre><code>public class MkistatVsUserLogin
  {
      public mkistat mkistats { get; set; }
      public idx Idxs { get; set; }
  }
  </code></pre>
  
  <p>How can I solve this problem. Need this help badly. Tnx.</p>
  
  <p>UPDATES</p>
  
  <p><strong>Mkistat Model</strong></p>
  
  <pre><code>public partial class mkistat
  {
      public string MKISTAT_CODE { get; set; }
      public int MKISTAT_NUMBER { get; set; }
      public string MKISTAT_QUOTE_BASES { get; set; }
      public decimal MKISTAT_OPEN_PRICE { get; set; }
      public decimal MKISTAT_HIGH_PRICE { get; set; }
      public decimal MKISTAT_LOW_PRICE { get; set; }
      public decimal MKISTAT_SPOT_TOTAL_VALUE { get; set; }
      public string MKISTAT_LM_DATE_TIME { get; set; }        
  }
  </code></pre>