Пример #1
0
 public static SqlParameter[] GetSpParameterSet(string connectionString, string spName)
 {
     return(SqlHelperParameterCache.GetSpParameterSet(connectionString, spName, false));
 }
        public static SqlParameter[] GetSpParameterSet(string connectionString, string spName, bool includeReturnValueParameter)
        {
            string hashKey = connectionString + ":" + spName + (includeReturnValueParameter ? ":include ReturnValue Parameter" : "");

            SqlParameter[] cachedParameters = (SqlParameter[])SqlHelperParameterCache.paramCache[hashKey];
            if (cachedParameters == null)
            {
                cachedParameters = (SqlParameter[])(SqlHelperParameterCache.paramCache[hashKey] = SqlHelperParameterCache.DiscoverSpParameterSet(connectionString, spName, includeReturnValueParameter));
            }
            return(SqlHelperParameterCache.CloneParameters(cachedParameters));
        }