Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ RowUpdatingHandlerBuilder()

void System.Data.Common.DbCommandBuilder.RowUpdatingHandlerBuilder ( RowUpdatingEventArgs rowUpdatingEvent)
inlineprivate

Definition at line 1308 of file DbCommandBuilder.cs.

1309 {
1310 DataRow row = rowUpdatingEvent.Row;
1311 BuildCache(closeConnection: false, row, useColumnsForParameterNames: false);
1312 DbCommand dbCommand = rowUpdatingEvent.StatementType switch
1313 {
1314 StatementType.Insert => BuildInsertCommand(rowUpdatingEvent.TableMapping, row),
1315 StatementType.Update => BuildUpdateCommand(rowUpdatingEvent.TableMapping, row),
1316 StatementType.Delete => BuildDeleteCommand(rowUpdatingEvent.TableMapping, row),
1317 _ => throw ADP.InvalidStatementType(rowUpdatingEvent.StatementType),
1318 };
1319 if (dbCommand == null)
1320 {
1321 row?.AcceptChanges();
1322 rowUpdatingEvent.Status = UpdateStatus.SkipCurrentRow;
1323 }
1324 rowUpdatingEvent.Command = dbCommand;
1325 }
DbCommand BuildUpdateCommand(DataTableMapping mappings, DataRow dataRow)
void BuildCache(bool closeConnection, DataRow dataRow, bool useColumnsForParameterNames)
DbCommand BuildInsertCommand(DataTableMapping mappings, DataRow dataRow)
DbCommand BuildDeleteCommand(DataTableMapping mappings, DataRow dataRow)

References System.Data.DataRow.AcceptChanges(), System.Data.Common.DbCommandBuilder.BuildCache(), System.Data.Common.DbCommandBuilder.BuildDeleteCommand(), System.Data.Common.DbCommandBuilder.BuildInsertCommand(), System.Data.Common.DbCommandBuilder.BuildUpdateCommand(), System.Data.Common.ADP.InvalidStatementType(), System.Data.Common.RowUpdatingEventArgs.Row, System.Data.Common.RowUpdatingEventArgs.StatementType, and System.Data.Common.RowUpdatingEventArgs.TableMapping.

Referenced by System.Data.Common.DbCommandBuilder.RowUpdatingHandler().