title: LINQ to Entities does not recognize the method and this method cannot be translated into a store expression
body: <p>I call some date in my database using entity frame work. but My below code giving this error</p>
  
  <p><strong>LINQ to Entities does not recognize the method 'SchoolBreifcase.Compliance get_Item(Int32)' method, and this method cannot be translated into a store expression.</strong></p>
  
  <p>Here is my full code</p>
  
  <pre><code>FinancialCompliance financialCompliance = new FinancialCompliance();
              List&lt;Compliance&gt; compliance = null;
              if (HttpContext.Current.User.IsInRole("SchoolAdmin"))
              {
  
                  compliance = datamodel.Compliances.Where(u =&gt; u.UserId == userId).OrderBy(c =&gt; c.AddedDate).ToList();
  
              }
              if (HttpContext.Current.User.IsInRole("User"))
              {
                  compliance = datamodel.Compliances.Where(u =&gt; u.VerifierId == userId || u.OwnerId == userId).OrderBy(c =&gt; c.AddedDate).ToList();
              }
              if (compliance != null)
              {
                  for (int i = 1; i &lt; compliance.Count; i++)
                  {
                      financialCompliance = datamodel.FinancialCompliances.Where(f =&gt; f.ComplianceId == compliance[i].ComplianceId).SingleOrDefault();
                      if (compliance.Count == i)
                      {
                          return financialCompliance;
                      }
                  }
              }
              return financialCompliance;
          }
  </code></pre>
  
  <p>This line give that error:</p>
  
  <pre><code>financialCompliance = datamodel.FinancialCompliances.Where(f =&gt; f.ComplianceId == compliance[i].ComplianceId).SingleOrDefault();
  </code></pre>
  
  <p><strong>Does not help stack over flow answer</strong>
  I have find some answers in this stack overflow site for</p>
  
  <p><a href="https://stackoverflow.com/questions/3554630/linq-to-entities-does-not-recognize-the-method">LINQ to Entities does not recognize the method</a></p>
  
  <p>etc..<strong>But does not help to me .So I asked this question . Please don't any one close this question for reason  of already asked</strong> </p>