protected int InsertRow(IDictionary <string, object> row, IDbCommand command) { var values = new object[command.Parameters.Count]; foreach (var kvp in row) { int index = _columns.IndexOf(_table.FindColumn(kvp.Key)); if (index > -1) { values[index] = kvp.Value; } } CommandHelper.SetParameterValues(command, values); return(TryExecute(command)); }
protected IDictionary <string, object> InsertRow(IDictionary <string, object> row, IDbCommand insertCommand, IDbCommand selectCommand) { var values = new object[insertCommand.Parameters.Count]; foreach (var kvp in row) { int index = _columns.IndexOf(_table.FindColumn(kvp.Key)); if (index > -1) { values[index] = kvp.Value; } } CommandHelper.SetParameterValues(insertCommand, values); if (TryExecute(insertCommand) == 1) { return(TryExecuteSingletonQuery(selectCommand)); } return(null); }