Commit d0a96d8
committed
Bypass unsaved relationships
Typically, relationships will point to established topic entities that have been saved. When saving large topic graphs, however, relationships may point to topics which have not yet been saved—in which case they will be pointing to a topic with the `Id` of `-1`. If this is persisted to the database, a foreign key violation will occur.
This is a known limitation of the library, which currently requires calling `Save()` twice in these scenarios. That's an unfortunate if edge scenario. But that scenario should not yield FKC violations on the initial `Save()`. To mitigate that, we'll just ignore any relationships pointing to an unsaved `Topic`.1 parent 852a33e commit d0a96d8
1 file changed
Lines changed: 5 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
585 | 585 | | |
586 | 586 | | |
587 | 587 | | |
| 588 | + | |
| 589 | + | |
| 590 | + | |
| 591 | + | |
| 592 | + | |
588 | 593 | | |
589 | 594 | | |
590 | 595 | | |
| |||
0 commit comments