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