protected Func <bool> GetIdComparer(Row r1, Row r2, out ValueGetter <RowId> idGetter)
        {
            var g1 = r1.GetIdGetter();

            idGetter = g1;
            var   g2 = r2.GetIdGetter();
            RowId v1 = default(RowId);
            RowId v2 = default(RowId);

            return
                (() =>
            {
                g1(ref v1);
                g2(ref v2);
                return v1.Equals(v2);
            });
        }
Beispiel #2
0
 public bool Equals(CellId other)
 {
     return(RowId.Equals(other.RowId) &&
            ColumnOffset.Equals(other.ColumnOffset));
 }
        public void SetValue(int column, RowId rowid, object value)
        {
            if (updateType == 'R' || updateType == ' ')
                throw new InvalidOperationException("Incorrect state to update");

            if (!rowid.Equals(currentRow.Id))
                throw new InvalidOperationException("rowid does not reference a mutable row");

            int ncol = column;
            if (project != null) {
                // Map the given 'col' into a column in the native table
                // Get the projection op
                Expression col_projection = project[column];
                // Turn it into a var
                Variable var = QueryProcessor.GetAsVariableRef(col_projection);
                // If it's not a var,
                if (var == null)
                    throw new InvalidOperationException("Column is not updatable.");

                // Look up the column in the source table
                ncol = backedTable.Columns.IndexOf(var.Name);
                // If not found
                if (ncol == -1)
                    throw new InvalidOperationException("Column is not updatable.");
            }

            // Set the contents of the native table!
            currentRow.SetValue(ncol, new SqlObject(value));
        }