Commit 42b6c84
committed
Fixed validation of
When doing a recursive `Save()`, the `ParentID` attribute of each child topic was being validated to ensure that it had correctly been set to a positive number—i.e., that the parent's `Id` had been properly set from the database. There were two issues with this. First, we really only need to check that once, when the `topic.Id` is set, not for each child. Second, it was being checked _prior_ to the `ParentID` being set on the child. While I was at it, I set the `ParentID` based on `topic.Id` not `returnVal`; these will be the same, but the semantics are a bit clearer.ParentId for recursive Save()
1 parent f92afc2 commit 42b6c84
1 file changed
Lines changed: 7 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
796 | 796 | | |
797 | 797 | | |
798 | 798 | | |
| 799 | + | |
| 800 | + | |
| 801 | + | |
| 802 | + | |
| 803 | + | |
799 | 804 | | |
800 | 805 | | |
801 | 806 | | |
| |||
827 | 832 | | |
828 | 833 | | |
829 | 834 | | |
| 835 | + | |
830 | 836 | | |
831 | 837 | | |
832 | 838 | | |
833 | 839 | | |
834 | 840 | | |
835 | | - | |
836 | | - | |
837 | | - | |
838 | | - | |
839 | | - | |
| 841 | + | |
840 | 842 | | |
841 | 843 | | |
842 | 844 | | |
| |||
0 commit comments