MicroLite.Builder.SelectSqlBuilder.AndWhere C# (CSharp) Method

AndWhere() public method

public AndWhere ( string column ) : IWhereSingleColumn
column string
return IWhereSingleColumn
        public IWhereSingleColumn AndWhere(string column)
        {
            if (string.IsNullOrEmpty(column))
            {
                throw new ArgumentException(ExceptionMessages.ArgumentNullOrEmpty.FormatWith("column"));
            }

            this.Operand = " AND";
            this.WhereColumnName = this.SqlCharacters.EscapeSql(column);

            return this;
        }

Same methods

SelectSqlBuilder::AndWhere ( string predicate ) : IAndOrOrderBy

Usage Example

        public void AndWhereThrowsArgumentExceptionForNullPredicate()
        {
            var sqlBuilder = new SelectSqlBuilder(SqlCharacters.Empty);

            var exception = Assert.Throws<ArgumentException>(
                () => sqlBuilder.AndWhere(null, new object()));

            Assert.Equal(ExceptionMessages.ArgumentNullOrEmpty.FormatWith("predicate"), exception.Message);
        }
All Usage Examples Of MicroLite.Builder.SelectSqlBuilder::AndWhere