public NpgsqlCommand Clone()
{
// TODO: Add consistency checks.
NpgsqlCommand clone = new NpgsqlCommand(CommandText, Connection, Transaction);
clone.CommandTimeout = CommandTimeout;
clone.CommandType = CommandType;
clone.DesignTimeVisible = DesignTimeVisible;
if (ExpectedTypes != null)
{
clone.ExpectedTypes = (Type[])ExpectedTypes.Clone();
}
foreach (NpgsqlParameter parameter in Parameters)
{
clone.Parameters.Add(parameter.Clone());
}
return clone;
}