0607f02e93791fc14cdc263952ba021b7547bc6a
PrebuiltDeckCard.Id is always a NewGuid() (never Guid.Empty), so the old `if (entry.Id != Guid.Empty) Db.PrebuiltDeckCards.Remove(entry)` guard was always true. When a user added a card then removed it before saving, EF detached the Added entity from the collection, then the explicit Db.Remove re-attached it as Deleted. SaveChangesAsync then tried to DELETE a row that was never inserted → DbUpdateConcurrencyException. Drop the explicit remove call entirely. EF Core automatically marks Unchanged orphans as Deleted when removed from a required relationship collection, and simply detaches Added orphans — both are the correct outcomes without any extra Db.Remove. 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%