/************************************************************************/ #region Constructor /// <summary> /// Initializes a new instance of the <see cref="TableBase"/> class. /// </summary> /// <param name="controller">The database controller object.</param> /// <param name="schemaName">The name of the schema this table belongs to.</param> /// <param name="tableName">The name of the table.</param> protected TableBase(DatabaseControllerBase controller, string schemaName, string tableName) { if (string.IsNullOrEmpty(schemaName)) { throw new ArgumentNullException(nameof(schemaName)); } if (string.IsNullOrEmpty(tableName)) { throw new ArgumentNullException(nameof(tableName)); } Controller = controller ?? throw new ArgumentNullException(nameof(controller)); Namespace = schemaName; TableName = tableName; IsReadOnly = false; IsDeleteRestricted = false; Adapter = new SQLiteDataAdapter { SelectCommand = new SQLiteCommand(controller.Connection), InsertCommand = new SQLiteCommand(controller.Connection), UpdateCommand = new SQLiteCommand(controller.Connection), DeleteCommand = new SQLiteCommand(controller.Connection) }; changedEligibleColumns = new Dictionary <DataRow, List <DataColumn> >(); }
/************************************************************************/ #region Constructor /// <summary> /// Initializes a new instance of the <see cref="ApplicationTableBase"/> class using the specified schema name. /// </summary> /// <param name="controller">The controller</param> /// <param name="schemaName">The schema name.</param> /// <param name="tableName">The table name</param> protected ApplicationTableBase(DatabaseControllerBase controller, string schemaName, string tableName) : base(controller, schemaName, tableName) { }
/************************************************************************/ #region Constructor internal TransactionAdapter(DatabaseControllerBase controller) { this.controller = controller ?? throw new ArgumentNullException("TransactionAdapter.Controller"); }
/// <summary> /// Initializes a new instance of the <see cref="TableBase"/> class. /// </summary> /// <param name="controller">The database controller object.</param> /// <param name="tableName">The name of the table.</param> protected TableBase(DatabaseControllerBase controller, string tableName) : this(controller, DatabaseControllerBase.MainSchemaName, tableName) { }