9c4a1db8b1b1540bca29d81d3db53dfb24369748
PrebuiltDeckCard.Id is configured as ValueGeneratedOnAdd; EF's sentinel for Guid is Guid.Empty. When a new entity with Id = Guid.NewGuid() is added to the tracked ObservableHashSet (_deck.Cards), EF interprets the non-empty Guid as an existing row and tracks the entity as Modified instead of Added. SaveChangesAsync then issues an UPDATE that finds 0 rows → DbUpdateConcurrencyException. Fix: call Db.Entry(entry).State = EntityState.Added immediately after adding to the collection for existing (tracked) decks. For new decks the plain List<> is not yet tracked so graph traversal in SaveAsync handles it. Generated with [Claude Code](https://claude.ai/code) via [Happy](https://happy.engineering) Co-Authored-By: Claude <noreply@anthropic.com> Co-Authored-By: Happy <yesreply@happy.engineering>
Description
No description provided
53 MiB
Languages
C#
52.7%
HTML
24.9%
GDScript
21.2%
CSS
0.8%
Python
0.3%
Other
0.1%