/// <summary>准备执行命令</summary> public override void Prepare() { var conn = DbConnection; if (conn?.State != ConnectionState.Open) { throw new InvalidOperationException("数据库连接未打开"); } if (CommandText.IsNullOrEmpty()) { throw new InvalidOperationException("未设置命令文本"); } }