/// <summary> /// Initializes a new instance of the <see cref="TableCommand{T}"/> class. /// </summary> /// <param name="tableCommandFactory"> /// The table command provider. /// </param> /// <param name="databaseContext"> /// The database context. /// </param> /// <exception cref="ArgumentNullException"> /// <paramref name="tableCommandFactory"/> is null. /// </exception> protected TableCommand([NotNull] IDbTableCommandFactory tableCommandFactory, [NotNull] IDatabaseContext databaseContext) { this.tableCommandFactory = tableCommandFactory ?? throw new ArgumentNullException(nameof(tableCommandFactory)); this.DatabaseContext = databaseContext ?? throw new ArgumentNullException(nameof(databaseContext)); this.EntityDefinition = this.DatabaseContext.RepositoryAdapter.DefinitionProvider.Resolve <T>(); this.NameQualifier = this.DatabaseContext.RepositoryAdapter.NameQualifier; }
/// <summary> /// Initializes a new instance of the <see cref="TransactSqlMergeBase{T}"/> class. /// </summary> /// <param name="tableCommandFactory"> /// The table command factory. /// </param> /// <param name="databaseContext"> /// The database context. /// </param> protected TransactSqlMergeBase(IDbTableCommandFactory tableCommandFactory, IDatabaseContext databaseContext) : base(tableCommandFactory, databaseContext) { this.insertAttributes.AddRange(this.EntityDefinition.InsertableAttributes); this.mergeMatchAttributes.AddRange(this.EntityDefinition.PrimaryKeyAttributes); }
/// <summary> /// Initializes a new instance of the <see cref="TransactSqlInsertBase{T}" /> class. /// </summary> /// <param name="tableCommandFactory"> /// The table command factory. /// </param> /// <param name="databaseContext"> /// The database context. /// </param> protected TransactSqlInsertBase([NotNull] IDbTableCommandFactory tableCommandFactory, IDatabaseContext databaseContext) : base(tableCommandFactory, databaseContext) { }
/// <summary> /// Initializes a new instance of the <see cref="JsonMerge{T}"/> class. /// </summary> /// <param name="commandFactory"> /// The command factory to use to create the command. /// </param> /// <param name="databaseContext"> /// The database context for the merge. /// </param> public JsonMerge(IDbTableCommandFactory commandFactory, IDatabaseContext databaseContext) : base(commandFactory, databaseContext) { }
/// <summary> /// Initializes a new instance of the <see cref="TableValuedMerge{T}"/> class. /// </summary> /// <param name="commandFactory"> /// The command factory to use to create the command. /// </param> /// <param name="databaseContext"> /// The database context. /// </param> public TableValuedMerge(IDbTableCommandFactory commandFactory, IDatabaseContext databaseContext) : base(commandFactory, databaseContext) { }