public void Write(ChildrenList_CreateOnlyParentReadonlyRaw childrenList_CreateOnlyParentReadonlyRaw) { if (childrenList_CreateOnlyParentReadonlyRaw.Key != nextKey) { throw new Exception($"ChildrenList_CreateOnlyParentReadonlyRaw's key {childrenList_CreateOnlyParentReadonlyRaw.Key} should be {nextKey}."); } nextKey++; csvWriter.StartNewLine(); csvWriter.Write(childrenList_CreateOnlyParentReadonlyRaw.Text); csvWriter.WriteEndOfLine(); }
public bool ReadLine([NotNullWhen(true)] out ChildrenList_CreateOnlyParentReadonlyRaw?childrenList_CreateOnlyParentReadonlyRaw) { if (csvReader.IsEndOfFileReached()) { csvReader.Dispose(); childrenList_CreateOnlyParentReadonlyRaw = null; return(false); } childrenList_CreateOnlyParentReadonlyRaw = new ChildrenList_CreateOnlyParentReadonlyRaw(); childrenList_CreateOnlyParentReadonlyRaw.Key = nextKey++; childrenList_CreateOnlyParentReadonlyRaw.Text = csvReader.ReadString(); csvReader.ReadEndOfLine(); return(true); }