I want to delete records of sql database using linq lambda expression. What should I do?
Here 'student' is my table and 'db' is object of .edmx file
public bool DeleteRecord(int caurseID)
{
studentEntities db = new studentEntities();
int count = db.student.Where(s => s.caurse_id == caurseID).Count();
if (count != 0)
{
//string subQuery = "delete from student where caurse_id=" + caurseID;
//SqlCommand subCmd = new SqlCommand(subQuery, conn);
//subCmd.ExecuteNonQuery();
db.student. : For Delete, what will be goes here???
}
return true;
}