List 高人写的代码居然没有new 是不是有误
我看见高人写的代码居然没有new好奇怪,如下
CommandInfo cmd = new CommandInfo(strSql2.ToString(), parameters2);
sqllist.Add(cmd);
CommandInfo 类的内容如下
public class CommandInfo
{
public string CommandText;
public System.Data.Common.DbParameter[] Parameters;
public CommandInfo(string sqlText, SqlParameter[] para)
{
this.CommandText = sqlText;
this.Parameters = para;
}
}
这个高人写的代码有误吗