title: Getting error: "does not contain a public definition for 'GetEnumerator'"
body: <p>I am trying to following <a href="http://oakdome.com/programming/MVC3_Simple_DBContext_Class.php" rel="nofollow">this</a> example but getting stuck to fetch data</p>
  
  <p>I am getting error:</p>
  
  <pre><code>Compiler Error Message: CS1579: foreach statement cannot operate on variables of type 'RMA.Models.RMAs' because 'RMA.Models.RMAs' does not contain a public definition for 'GetEnumerator'
  </code></pre>
  
  <p>Code Files Given below:</p>
  
  <p><strong>RMAModel.cs</strong></p>
  
  <pre><code>using System;
  using System.Collections.Generic;
  using System.Linq;
  using System.Web;
  using System.ComponentModel.DataAnnotations;
  
  namespace RMA.Models
  {
      public class RMAs
      {
          [Key]
          public int RNumber { get; set; }
          public int OrderNumber { get; set; }
      }
  }
  </code></pre>
  
  <p><strong>DBContext Model.cs</strong></p>
  
  <pre><code>using System.Data.Entity; 
  using RMA.Models;
  
  namespace RMA.DAL
  {
      public class DBContext_Model:DbContext
      {
          public DbSet&lt;RMAs&gt; RMAs { get; set; }
      }
  }
  </code></pre>
  
  <p><strong>ListController.cs</strong></p>
  
  <pre><code>using System;
  using System.Collections.Generic;
  using System.Linq;
  using System.Web;
  using System.Web.Mvc;
  using RMA.DAL;
  using RMA.Models;
  
  namespace RMA.Controllers
  {
      public class ListController : Controller
      {
          private DBContext_Model db = new DBContext_Model();
  
          public ActionResult Index()
          {
              var items = db.RMAs;
              return View(items.ToList());
          }
  
      }
  }
  </code></pre>
  
  <p><strong>index.cshtml</strong></p>
  
  <pre><code>@model RMA.Models.RMAs
  
  @{
      ViewBag.Title = "List of RMAs";
  }
  
  &lt;h2&gt;Index&lt;/h2&gt;
  @foreach (RMA.Models.RMAs i in Model)
  {
      &lt;span&gt;@i.OrderNumber&lt;/span&gt;
  }
  </code></pre>
  
  <p><strong>webconfig</strong></p>
  
  <pre><code>&lt;connectionStrings&gt;
      &lt;add name="DBContext_Model"
           connectionString="Server=xx\xx;Database=xxx;Integrated Security=True;"
           providerName="System.Data.SqlClient" /&gt;
    &lt;/connectionStrings&gt;
  </code></pre>
  
  <p><strong>I am using mvc3 Framework with .NET Framework 4 on VS2010</strong></p>