private static DaoExecutor CreateCommand(ISqlStatement sql, object parameters) { Dao dao = string.IsNullOrEmpty(sql.Connection) ? Dao.Get() : Dao.Get(sql.Connection); ISqlCommand command = sql.CreateCommand(dao.Provider, parameters); return(new DaoExecutor { Command = command, Dao = dao }); }
private static DaoExecutor CreateCommand(string key, object parameters) { ISqlStatement sql = DaoFactory.GetSqlSource().Find(key, Dao.Get().Provider.Name); if (null == sql) { throw new FoxOneException(string.Format("sql command '{0}' not found", key)); } Dao dao = string.IsNullOrEmpty(sql.Connection) ? Dao.Get() : Dao.Get(sql.Connection); return(new DaoExecutor { Command = sql.CreateCommand(dao.Provider, parameters), Dao = dao }); }