Beispiel #1
0
        public void AddCondition(bool notIn, string tableName, string fieldName, SqlLamBase sqlQuery)
        {
            var innerQuery = sqlQuery.SqlString;

            foreach (var name in sqlQuery.Parameters)
            {
                //var param = name.Key;
                //var innerParamKey = "Inner" + param;
                //innerQuery = Regex.Replace(innerQuery, param, innerParamKey);
                //AddParameter(innerParamKey, name.Value);
                this.AddParameter(name.Key, name.Value);
            }
            string op           = notIn ? "NOT IN" : "IN";
            var    newCondition = string.Format("{0} {2} ({1})", _adapter.Field(tableName, fieldName), innerQuery, op);

            _conditions.Add(newCondition);
        }
Beispiel #2
0
 public SqlLam <T> WhereNotIn(Expression <Func <T, object> > expression, SqlLamBase sqlQuery)
 {
     _builder.And();
     _resolver.QueryByIsIn(true, expression, sqlQuery);
     return(this);
 }