public void Dispose() { _baseDao = null; }
public DALContext(string connectionKey) { _connectionKey = connectionKey; _baseDao = new BaseDaoExt(_connectionKey); //_baseDao = BaseDaoFactory.CreateBaseDao(_connectionKey); }
public static DbCommand BuildDynamicParam(string toReplaceString, string strSql, string strParam, char sperateSymbol, DbCommand dbCommand, DbType dbType, BaseDaoExt DB) { StringBuilder sb = new StringBuilder(); string[] ids = strParam.Split(sperateSymbol); List <string> keys = new List <string>(); for (var i = 0; i < ids.Length; i++) { string key = "@key" + i; keys.Add(key); sb.Append(key + ","); } strSql = strSql.Replace(toReplaceString, sb.ToString().TrimEnd(',')); //DbCommand dbCommand = DB.GetSqlStringCommand(strSql); for (var i = 0; i < ids.Length; i++) { DB.AddInParameter(dbCommand, keys[i], dbType, ids[i]); } dbCommand.CommandText = strSql; return(dbCommand); }