/// <summary> /// Adds a row to the table based on the information in the passed in form. /// </summary> /// <param name="rowForm">A row form.</param> /// <returns></returns> public bool AddRow(RowForm2 rowForm) { bool isSuccessful; if (rowForm is null) { throw new ArgumentNullException(nameof(rowForm)); } if (rowForm.IsLocal(_process)) { isSuccessful = AddRowLocally(rowForm); } else { isSuccessful = AddRowRemotely(rowForm); } return(isSuccessful); }
/// <summary> /// Adds a row to this FrostDb instance /// </summary> /// <param name="rowForm">The row data to add</param> /// <returns>True if successful, otherwise false</returns> private bool AddRowLocally(RowForm2 rowForm) { RowInsert rowToInsert = new RowInsert(rowForm.Values, this.Schema, rowForm.Participant.Id, !rowForm.IsLocal(_process), rowForm.Address); if (_storage.RecordTransactionInLog(rowToInsert)) { if (_cache.InsertRow(rowToInsert)) { if (_storage.UpdateIndexes(rowToInsert)) { _cache.SyncTreeToDisk(rowToInsert.Address); _storage.MarkTransactionAsReconciledInLog(rowToInsert); } } } //throw new NotImplementedException(); return(true); }