C
C#3y ago
gianmonky

Net core 6 Web api update-add collections to a created entity [Answered]

I am trying to update an entity that has a collection, when creating it with 1 item in the collection it works, when editing that single item too, but when i'm editing and add one more to the collection it stops working I'm doing a foreach(var item in entity.collection) for this, I understand that as long as it's not deleting it shouldn't interfere with the foreach, the item already exists in the array so... One option is to delete all existing items in the db and create them anew on each edit, but there must be something better.
5 Replies
mikernet
mikernet3y ago
Your question isn't doesn't make the problem particularly clear
but when (editing) I add one more it stops working
Not sure what that means exactly
gianmonky
gianmonkyOP3y ago
but when i'm editing and add one more to the collection it stops working, I speak English the best I can XD
mikernet
mikernet3y ago
Post some code or something because the problem is not clear from your question
Unknown User
Unknown User3y ago
Message Not Public
Sign In & Join Server To View
Accord
Accord3y ago
✅ This post has been marked as answered!
Want results from more Discord servers?
Add your server