Esempio n. 1
0
 /// <summary>
 /// Add parameter
 /// </summary>
 /// <param name="parameter">Parameter item</param>
 public void Add(ParameterItem parameter)
 {
     if (parameter == null)
     {
         return;
     }
     if (Parameters.ContainsKey(parameter.Name))
     {
         Parameters[parameter.Name] = parameter;
     }
     else
     {
         Parameters.Add(parameter.Name, parameter);
     }
 }
Esempio n. 2
0
        /// <summary>
        /// Add parameter
        /// </summary>
        /// <param name="name">Parameter name</param>
        /// <param name="value">Parameter value</param>
        /// <param name="dbType">DbType</param>
        /// <param name="direction">Direction</param>
        /// <param name="size">Size</param>
        /// <param name="precision">Precision</param>
        /// <param name="scale">Scale</param>
        public void Add(string name, object value = null, DbType?dbType = null, ParameterDirection?direction = null, int?size = null, byte?precision = null, byte?scale = null)
        {
            var item = new ParameterItem()
            {
                Name  = name,
                Value = value,
                ParameterDirection = direction ?? ParameterDirection.Input,
                DbType             = dbType,
                Size      = size,
                Precision = precision,
                Scale     = scale
            };

            Add(item);
        }