title: How to count the number of records in the model with ASP.NET MVC?
body: <p>I want to count the number of records contained in the Suspenses property with a year of "2013" and a month of "1".</p>
  
  <p>I get the error when I run the below code: "DbComparisonExpression requires arguments with comparable types." I'm still new to ASP.Net MVC, not sure if this is the way to get my results. Hopefully I can learn from your comments. Your help will be appreciated.</p>
  
  <pre><code> var suspenses = db.Suspenses.Include(s =&gt; s.User);
   int[] count = new int[12];
  
   for (var i = 1; i &lt;= 12; i++)
   {
       // to count number of account suspenses on every months
       suspenses = suspenses.Where(s =&gt; s.SuspenseDate.Year.Equals(year));
       suspenses = suspenses.Where(s =&gt; s.SuspenseDate.Month.Equals(i));
       count[i-1] = suspenses.Count();
   }
  </code></pre>