public void TestNotIn_1() { //结果 var result = new String(); result.Append("Where [user].[Email] Not In (@_p_0,@_p_1)"); //执行 var list = new List <string> { "a", "b" }; _clause.NotIn("user.Email", list); //验证 Assert.Equal(result.ToString(), GetSql()); }
/// <summary> /// 设置Not In条件 /// </summary> /// <typeparam name="TEntity">实体类型</typeparam> /// <param name="expression">列名表达式,范例:t => t.Name</param> /// <param name="values">值集合</param> /// <returns></returns> public ISqlBuilder NotIn <TEntity>(Expression <Func <TEntity, object> > expression, IEnumerable <object> values) where TEntity : class { WhereClause.NotIn(expression, values); return(this); }
/// <summary> /// 设置Not In条件 /// </summary> /// <param name="column">列名</param> /// <param name="values">值集合</param> /// <returns></returns> public ISqlBuilder NotIn(string column, IEnumerable <object> values) { WhereClause.NotIn(column, values); return(this); }