hi,
im following bellow code to update an entity model. But i got following eroor. : Store update, insert, or delete statement affected an unexpected number of rows (0)
And reason of this error is also known, it's only due to-that property does not exist in database. For that i found have only one option : first check that entity exist or not, then update it.
But, as i'm updating 10,000+ rows at a time, it will be time consuming to check each time in database if this property exist or not.
Is there any another way to solve this ?
Thank you.
foreach (Property item in listProperties)
{
db.Properties.Attach(item);
db.Entry(item).Property(x => x.pState).IsModified = true;
}
db.SaveChanges();