forum

home / developersection / forums / update problems in entity framework

Update problems in Entity Framework

Anonymous User 2635 28-Sep-2013

I want update my table with two conditions :

Type == "Employee" && Approved == false

and I use this code :

using (NoavaranModel.NoavaranEntities1 db=new NoavaranModel.NoavaranEntities1())

{
    var query = db.Students.Where(p => p.Type == " Employee" && p.Approved == false).Single();
    query.IsRecivedSMS = true;
    db.SaveChanges();
}

but it's not working. Just updates one recode in db. How can I update all rows with above conditions in Entity Framework?


Updated on 28-Sep-2013

I am a content writter !

Can you answer this question?

Answer

1 Answers

Liked By