When trying to execute the following queryvar del = context.Documents.Remove((context.Documents.Where(doc => doc.DocumentID == ((int)dataGridView1.SelectedCells[0].Value)).FirstOrDefault()));
The error takes off:
A raw exception of type "System.NotSupportedException" in EntityFramework.SqlServer.dll
For more information, the LINQ to Entities doesn’t recognize the system.Windows.Forms.DataGridViewCell get_Item (Int32) method.
Where is the mistake?