/// <summary> /// /// </summary> /// <param name="parameter"></param> public void AddParameter(IDbParameter parameter) { if (!_parameters.ContainsKey(parameter.ParameterName)) { _parameters[parameter.ParameterName] = parameter; } }
private IDbParameters AddWithKeyCheck(IDbParameter dbParameter) { if (ContainsKey(dbParameter.Name)) { throw new InvalidOperationException("DbParameter with the specified key already exists."); } _parameters.Add(dbParameter); return(this); }
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; } }
public SongRepository(IProvider provider, IDbParameter dbParameter) { _provider = provider; _dbParameter = dbParameter; }
public PlaylistRepository(IProvider provider, IDbParameter dbParameter) { _provider = provider; _dbParameter = dbParameter; }
protected override void AddDbParameter(IDbCommand dbCommand, IDbParameter parameter) { throw new System.NotImplementedException(); }
public IDbParameters Add(IDbParameter dbParameter) => AddWithKeyCheck(dbParameter);