Example #1
0
        public SqlQueryDef(string sql, IEnumerable <object> parameters)
        {
            IEnumerable <IDataParameter> parms;

            if (parameters is IEnumerable <IDataParameter> )
            {
                parms    = (IEnumerable <IDataParameter>)parameters;
                QuerySql = sql;
            }
            else
            {
                ParameterParser pp = new ParameterParser(sql, parameters);
                QuerySql = pp.GetQuery();
                parms    = pp.Parameters;
            }


            QueryParameters.AddRange(parms);
        }
Example #2
0
 public SqlQueryDef(ISqlQuery query)
 {
     QuerySql = query.GetQuery();
     QueryParameters.AddRange(query.Parameters);
 }