title: MVC C# calling stored procedure with parameters the first parameter is not being recognised
body: <p>Can someone please it explain this to me? I have this stored proc:</p>
  
  <pre><code>ALTER proc [dbo].[Invoice_GetHomePageInvoices] (
        @AreaIdList varchar(max)
  ,      @FinancialYearStartDate datetime = null
  ,      @FinancialYearEndDate datetime = null
  ) as
  </code></pre>
  
  <p>In code I'm trying to call it like this:</p>
  
  <pre><code>var areasString = new SqlParameter("AreaIdList", "1,2");
  var startDate = new SqlParameter("FinancialYearStartDate", financialYear.StartDate);
  var endDate = new SqlParameter("FinancialYearEndDate", financialYear.EndDate);
  
  return _db.Database.SqlQuery&lt;HomePageInvoice&gt;("Invoice_GetHomePageInvoices", areasString, startDate, endDate);
  </code></pre>
  
  <p>I'm getting this error:</p>
  
  <blockquote>
    <p>Procedure or function 'Invoice_GetHomePageInvoices' expects parameter
    '@AreaIdList', which was not supplied.</p>
  </blockquote>
  
  <p>Say what? I've provided that parameter. Can someone please give me some insight into how to fix?</p>