Ejemplo n.º 1
0
        public object Clone()
        {
            var clone = new SqlCommandText(CommandText);

            clone.AddParameters(this);
            return(clone);
        }
Ejemplo n.º 2
0
 public void AddParameters(SqlCommandText source)
 {
     foreach (KeyValuePair <string, object> parameter in source.Parameters)
     {
         Parameters.Add(parameter.Key, parameter.Value);
     }
 }
Ejemplo n.º 3
0
        public SqlCommandText Concat(SqlCommandText other)
        {
            if (IsEmpty)
            {
                return((SqlCommandText)other.Clone());
            }

            if (other.IsEmpty)
            {
                return((SqlCommandText)Clone());
            }

            var concatenatedCommandText = new SqlCommandText($"({CommandText}) AND ({other.CommandText})");

            concatenatedCommandText.AddParameters(this);
            concatenatedCommandText.AddParameters(other);

            return(concatenatedCommandText);
        }