Пример #1
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="parameter"></param>
 public void AddParameter(IDbParameter parameter)
 {
     if (!_parameters.ContainsKey(parameter.ParameterName))
     {
         _parameters[parameter.ParameterName] = parameter;
     }
 }
Пример #2
0
        private IDbParameters AddWithKeyCheck(IDbParameter dbParameter)
        {
            if (ContainsKey(dbParameter.Name))
            {
                throw new InvalidOperationException("DbParameter with the specified key already exists.");
            }

            _parameters.Add(dbParameter);

            return(this);
        }
Пример #3
0
        protected virtual void AddDbParameter(IDbCommand dbCommand, IDbParameter parameter)
        {
            var cmdParameter = (IDataParameter)dbCommand.Parameters[parameter.Name];

            cmdParameter.Value     = parameter.DbValue;
            cmdParameter.Direction = parameter.Direction;

            if (parameter.DatabaseType.HasValue)
            {
                cmdParameter.DbType = parameter.DatabaseType.Value;
            }
        }
Пример #4
0
 public SongRepository(IProvider provider, IDbParameter dbParameter)
 {
     _provider    = provider;
     _dbParameter = dbParameter;
 }
Пример #5
0
 public PlaylistRepository(IProvider provider, IDbParameter dbParameter)
 {
     _provider    = provider;
     _dbParameter = dbParameter;
 }
 protected override void AddDbParameter(IDbCommand dbCommand, IDbParameter parameter)
 {
     throw new System.NotImplementedException();
 }
Пример #7
0
 public IDbParameters Add(IDbParameter dbParameter)
 => AddWithKeyCheck(dbParameter);