/// <summary> /// Specify a condition. /// </summary> /// <param name="expression"></param> /// <param name="collation">Only explicitly set the collation if there is a collation conflict.</param> /// <returns></returns> /// <exception cref="SqlBulkToolsException"></exception> public DeleteQueryReady <T> Where(Expression <Func <T, bool> > expression, string collation) { // _whereConditions list will only ever contain one element. BulkOperationsHelper.AddPredicate(expression, PredicateType.Where, _whereConditions, _parameters, _conditionSortOrder, Constants.UniqueParamIdentifier); _conditionSortOrder++; string leftName = BulkOperationsHelper.GetExpressionLeftName(expression, PredicateType.Or, "Collation"); _collationColumnDic.Add(BulkOperationsHelper.GetActualColumn(_customColumnMappings, leftName), collation); return(new DeleteQueryReady <T>(_tableName, _schema, _conditionSortOrder, _whereConditions, _parameters, _collationColumnDic, _customColumnMappings)); }
/// <summary> /// Specify a condition. /// </summary> /// <param name="expression"></param> /// <param name="collation">Only explicitly set the collation if there is a collation conflict.</param> /// <returns></returns> /// <exception cref="SqlBulkToolsException"></exception> public QueryUpdateReady <T> Where(Expression <Func <T, bool> > expression, string collation) { // _whereConditions list will only ever contain one element. BulkOperationsHelper.AddPredicate(expression, PredicateType.Where, _whereConditions, _sqlParams, _conditionSortOrder, Constants.UniqueParamIdentifier); _conditionSortOrder++; string leftName = BulkOperationsHelper.GetExpressionLeftName(expression, PredicateType.Or, "Collation"); _collationColumnDic.Add(leftName, collation); return(new QueryUpdateReady <T>(_singleEntity, _tableName, _schema, _columns, _customColumnMappings, _conditionSortOrder, _whereConditions, _sqlParams, _collationColumnDic)); }
/// <summary> /// Specify an additional condition to match on. /// </summary> /// <param name="expression">Only explicitly set the collation if there is a collation conflict.</param> /// <returns></returns> /// <exception cref="SqlBulkToolsException"></exception> public QueryUpdateReady <T> And(Expression <Func <T, bool> > expression) { BulkOperationsHelper.AddPredicate(expression, PredicateType.And, _andConditions, _sqlParams, _conditionSortOrder, appendParam: Constants.UniqueParamIdentifier); _conditionSortOrder++; return(this); }
/// <summary> /// Specify an additional condition to match on. /// </summary> /// <param name="expression"></param> /// <returns></returns> /// <exception cref="SqlBulkToolsException"></exception> public SimpleUpdateQueryReady <T> Or(Expression <Func <T, bool> > expression) { BulkOperationsHelper.AddPredicate(expression, PredicateType.Or, _orConditions, _sqlParams, _conditionSortOrder, appendParam: Constants.UniqueParamIdentifier); _conditionSortOrder++; return(this); }