Ejemplo n.º 1
0
        private static IDataParameter[] CreateParameterCopy(DbCommand command)
        {
            IDataParameterCollection parameters = (IDataParameterCollection)command.Parameters;

            IDataParameter[] originalParameters = new IDataParameter[parameters.Count];
            parameters.CopyTo((Array)originalParameters, 0);
            return(CachingMechanism.CloneParameters(originalParameters));
        }
Ejemplo n.º 2
0
        public IDataParameter[] GetCachedParameterSet(
            string connectionString,
            IDbCommand command)
        {
            string commandText = command.CommandText;

            return(CachingMechanism.CloneParameters((IDataParameter[])this.paramCache[(object)CachingMechanism.CreateHashKey(connectionString, commandText)]));
        }
Ejemplo n.º 3
0
        private static IDataParameter[] CreateParameterCopy(DbCommand command)
        {
            IDataParameterCollection parameters = command.Parameters;

            IDataParameter[] parameterArray = new IDataParameter[parameters.Count];
            parameters.CopyTo(parameterArray, 0);
            return(CachingMechanism.CloneParameters(parameterArray));
        }
Ejemplo n.º 4
0
        public void AddParameterSetToCache(
            string connectionString,
            IDbCommand command,
            IDataParameter[] parameters)
        {
            string commandText = command.CommandText;

            this.paramCache[(object)CachingMechanism.CreateHashKey(connectionString, commandText)] = (object)parameters;
        }
Ejemplo n.º 5
0
 public bool IsParameterSetCached(string connectionString, IDbCommand command)
 {
     return(this.paramCache[(object)CachingMechanism.CreateHashKey(connectionString, command.CommandText)] != null);
 }