title: How to delete a row from database using lambda linq?
body: <p>I want to perform a delete operation to unfriend a user in a certain android application I'm developing. The following method returns "Done" but the data doesn't delete from the table. What is the problem here?</p>
  
  <pre><code>public string deleteFriend(int user, int friend) {
      int i = db.Friends.Where(x =&gt; x.Person.Id == user &amp;&amp; x.Person1.Id == friend).Select(x =&gt; x.Id).First();           
      var rec=db.Friends.ToList();
      rec.RemoveAll(x=&gt;rec.Any(xx=&gt;xx.Id==i));
      db.SaveChanges();
      return "Done";
  }
  </code></pre>
  
  <p>I'm working with Entity frame work LINQ.</p>