Delete multiple rows by using the following conditions ، But the error..
Melks = Ent.Tbl_Melk.Where(d => d.Mantaghe == Mantaghe && d.Hoze == Hoze && d.Block == Block && d.Melk == Melk).All();
Ent.DeleteObject(Melks);
int r = Ent.SaveChanges();
if (r > 0)
{
return true;
}
else
{
return false;
}
Looking at your code it seems that
Melksis a boolean variable. You cannot callDeleteObject()supplying a boolean as the argument.You need to remove the
.All()predicate at the end of your LINQ statement and then delete each object returned by the query: