private Lookup_Child addChild(string info, Lookup_Parent parent, Lookup_ParentNullable?parentNullable, bool isStoring) { //var newChild = new Lookup_Child(info, parent, parentNullable, isStoring); //if (isStoring) { // expectedChildren.Add(newChild.Key, newChild.ToString()); // assertData(); //} //return newChild; if (isStoring) { DC.Data.StartTransaction(); new Lookup_Child(info, parent, parentNullable, isStoring: true); DC.Data.RollbackTransaction(); assertData(); parent = DC.Data.Lookup_Parents[parent.Key]; if (parentNullable != null) { parentNullable = DC.Data.Lookup_ParentNullables[parentNullable.Key]; } DC.Data.StartTransaction(); var newChild = new Lookup_Child(info, parent, parentNullable, isStoring: true); DC.Data.CommitTransaction(); expectedChildren.Add(newChild.Key, newChild.ToString()); assertData(); return(newChild); } else { return(new Lookup_Child(info, parent, parentNullable, isStoring: false)); } }
private void store(Lookup_Child newChild) { newChild.Store(); expectedChildren.Add(newChild.Key, newChild.ToString()); }