Good morning! I wanted to ask for your help just to see if there is a better way to do it.
Today I have a list of objects of type
Formation_RelationLineDeletted
and I make a foreach in this list, taking item by item giving the attach and saving the modifications in the bank according to the code below:
db.Formatacao_RelatorioLinhaDeletada.Attach(obj);
db.Entry<Formatacao_RelatorioLinhaDeletada>(obj).State = EntityState.Modified;
return (db.SaveChanges() > 0);
I would like to know if I can perform an attach to the whole list as if we were executing a SQL as below that updates multiple records with a single Update:
UPDATE TABELA SET a = 2 WHERE TESTE > 0
I hope the discussion of the galera but thank you already!