Source/NFX/DataAccess/CRUD/RowsetBase.cs
/// <summary>
/// Tries to find a row with the same set of key fields in this table and if found, replaces it and returns true,
///  otherwise inserts the row (if schemas match) and returns false. Optionally pass updateWhere condition
///   that may check whether update needs to be performed
/// </summary>
Tries to find a row with the same set of key fields in this table and if found, replaces it and returns true,
otherwise inserts the row (if schemas match) and returns false. Optionally pass updateWhere condition
that may check whether update needs to be performed
Tries to find a row with the same set of key fields in this table and if found replaces it and returns true otherwise inserts the row ( if schemas match ) and returns false . Optionally pass updateWhere condition that may check whether update needs to be performed
protected virtual UpdateResult DoUpsert(Row row, Func<Row, bool> updateWhere, Func<Row, Row, Row> rowUpgrade = null)
            {
               int insertIndex;
               int idx = SearchForRow(row, out insertIndex);
               if (idx<0)
               {
                  m_List.Insert(insertIndex, row);
                  return new UpdateResult(insertIndex, false);
               }
               if (updateWhere!=null && !updateWhere(m_List[idx]))
                  return new UpdateResult(-1, false);
               DoUpgrade(idx, row, rowUpgrade);
               return new UpdateResult(idx, true);
            }
protected virtual UpdateResult DoUpsert ( Row row , Func < Row , bool > updateWhere , Func < Row , Row , Row > rowUpgrade = null ) { int insertIndex ; int idx = SearchForRow ( row , out insertIndex ) ; if ( idx < 0 ) { m_List . Insert ( insertIndex , row ) ; return new UpdateResult ( insertIndex , false ) ; } if ( updateWhere != null && ! updateWhere ( m_List [ idx ] ) ) return new UpdateResult ( - 1 , false ) ; DoUpgrade ( idx , row , rowUpgrade ) ; return new UpdateResult ( idx , true ) ; }
Tries to find a row with the same set of key fields in this table and if found, replaces it and returns true,
otherwise inserts the row (if schemas match) and returns false.
Tries to find a row with the same set of key fields in this table and if found replaces it and returns true otherwise inserts the row ( if schemas match ) and returns false .
//where did not match
row
Row
updateWhere
Func<Row, bool>
rowUpgrade
Func<Row, Row, Row>