You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Because 'drinks' would not reflect the updates made in the foreach loop prior to calling Save.
I also removed two other extraneous ToArray() calls.
Here is the listing with the change:
vartable=new Products();//OH NO YOU DIDN't just pass in an integer inline without a parameter! //I think I might have... yesvardrinks= table.All("WHERE CategoryID = 8").ToArray();//what we get back here is an IEnumerable < ExpandoObject > - we can go to townforeach(var item in drinks){//turn them into Haack Snacks
item.CategoryID =12;}//Let's update these in bulk, in a transaction shall we?
table.Save(drinks);
The text was updated successfully, but these errors were encountered:
I tried the code that you had but it didn't work for me. After debugging I noticed that the array being passed into Save was not updated with the values set in the foreach loop.
I believe I've found a bug in your documentation dealing with bulk updating. I had to change:
to
Because 'drinks' would not reflect the updates made in the foreach loop prior to calling Save.
I also removed two other extraneous ToArray() calls.
Here is the listing with the change:
The text was updated successfully, but these errors were encountered: