C
C#2y 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
mikernet2y 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
gianmonky2y 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
mikernet2y ago
Post some code or something because the problem is not clear from your question
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
Accord
Accord2y ago
✅ This post has been marked as answered!