Delete All Measures. #896
SharmaAntriksh
started this conversation in
Other Topics
Replies: 1 comment
-
This is standard in .NET - you can't enumerate a collection that is being modified. Copying the objects you intend to enumerate into a list, is indeed the correct way of solving this. You can make it more compact by writing this: foreach (Table t in Model.Tables)
{
foreach (Measure m in t.Measures.ToList())
{
m.Delete();
}
} |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I am trying to delete every measure using the Delete Method however I don't understand why the below code isn't supported.
It throws an error that System.InvalidOperationException: Collection was modified; enumeration operation may not execute.
For now I am using an alternate way of loading table name and measure name in a list and then running the Model.Tables.Measure.Delete method
Beta Was this translation helpful? Give feedback.
All reactions