title: LINQ to Entities does not recognize the method 'Int32 ToInt32(Int32)' method, and this method cannot be translated into a store expression
body: <pre><code>for (int i = 0; i &lt; list.Count; i++)
  {
      var doesrequestExist = cxt.Friends.FirstOrDefault(u =&gt; (u.User_Id == incID) &amp;&amp;
           (u.Friend_UserId == (list.ElementAt(i).userid)) &amp;&amp; 
           (u.Request_Status == 0 || u.Request_Status == 1));
      if (doesrequestExist != null)
      {
      }
  </code></pre>
  
  <p>i am getting error at "list.ElementAt(i).userid"
  error:
  LINQ to Entities does not recognize the method 'Int32 ToInt32(Int32)' method, and this method cannot be translated into a store expression.</p>
  
  <p>Edit:</p>
  
  <p>By removing the convert.toint32 in above query getting:
  LINQ to Entities does not recognize the method 'FriendsList ElementAt[FriendsList](System.Collections.Generic.IEnumerable`1[FR_Network.FR_Network+FriendsList], Int32)' method, and this method cannot be translated into a store expression.</p>