Closed capesean closed 6 years ago
If I'm not mistaken, EFUtilities only inserts in columns that have been assigned values. So, if you're getting that error, it means you are assigning a value to CalculatePercent
somewhere in your code. Am I correct?
As for updates, here you explicitly pass a "list" of properties to update, so batch updates will never try to update values of columns when you don't want it to.
I ended up using db.Database.ExecuteSqlCommand
with explicit columns named, excluding the calculated columns. It was for a dataload, so it improved performance too. Pretty sure I wasn't touching the calculated field, though. I'll re-open if I come across it again.
I have a field/column that in my EF model is:
When I try
InsertAll
I get the errorThe column \"CalculatedPercent\" cannot be modified because it is either a computed column or is the result of a UNION operator.
I'd think these fields should be ignored for updates/inserts?