title: foreach statement cannot operate on variables of type '' because '' does not contain a public definition for 'GetEnumerator'
body: <p>I Got an Error Like This 
     Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately. </p>
  
  <pre><code>Compiler Error Message: CS1579: foreach statement cannot operate on variables of type 'EventListing.Models.EventInfo' because 'EventListing.Models.EventInfo' does not contain a public definition for 'GetEnumerator'
  
  Source Error:
  
  Line 106:                &lt;/th&gt;
  Line 107:            &lt;/tr&gt;
  Line 108:            &lt;% foreach (var model in Model)
  Line 109:               { %&gt;
  Line 110:            &lt;tr&gt;
  </code></pre>
  
  <p>Model</p>
  
  <pre><code>public static List&lt;EventInfo&gt; EventList()
          {
              var list = new List&lt;EventInfo&gt;();
              Dbhelper DbHelper = new Dbhelper();
              DbCommand cmd = DbHelper.GetSqlStringCommond("SELECT * FROM WS_EVENTINFO");
              DbDataReader Datareader = DbHelper.ExecuteReader(cmd);
              while (Datareader.Read())
              {
                  EventInfo eventinfo = new EventInfo()
                  {
                      EVENT_ID = Convert.ToInt32(Datareader[
  </code></pre>
  
  <p>View Page</p>
  
  <pre><code>&lt;%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage&lt;EventListing.Models.EventInfo&gt;" %&gt;
   &lt;% foreach (var model in Model)
                 { %&gt;
              &lt;tr&gt;
                  &lt;td&gt;
                      &lt;%= Html.ActionLink(Model.TITLE,"Detail", new {id = Model.EVENT_ID})%&gt;
  </code></pre>
  
  <p>How can solve this Issue, i'm Using MVC2 Framework.</p>