/// <summary> /// Creates a new instance of <see cref="SprocAccessor<TResult>"/> that works for a specific <paramref name="database"/> /// and uses <paramref name="resultSetMapper"/> to convert the returned set to an enumerable of clr type <typeparamref name="TResult"/>. /// The <paramref name="parameterMapper"/> will be used to interpret the parameters passed to the Execute method. /// </summary> /// <param name="database">The <see cref="Database"/> used to execute the Transact-SQL.</param> /// <param name="procedureName">The stored procedure that will be executed.</param> /// <param name="parameterMapper">The <see cref="IParameterMapper"/> that will be used to interpret the parameters passed to the Execute method.</param> /// <param name="resultSetMapper">The <see cref="IResultSetMapper<TResult>"/> that will be used to convert the returned set to an enumerable of clr type <typeparamref name="TResult"/>.</param> public Db2SprocAccessor(Db2Database database, string procedureName, IParameterMapper parameterMapper, IResultSetMapper <TResult> resultSetMapper) : base(database, resultSetMapper) { if (string.IsNullOrEmpty(procedureName)) { throw new ArgumentException("The value can not be a null or empty string."); } if (parameterMapper == null) { throw new ArgumentNullException(nameof(parameterMapper)); } _procedureName = procedureName; _parameterMapper = parameterMapper; }
/// <summary> /// Creates a new instance of <see cref="SprocAccessor<TResult>"/> that works for a specific <paramref name="database"/> /// and uses <paramref name="resultSetMapper"/> to convert the returned set to an enumerable of clr type <typeparamref name="TResult"/>. /// </summary> /// <param name="database">The <see cref="Database"/> used to execute the Transact-SQL.</param> /// <param name="procedureName">The stored procedure that will be executed.</param> /// <param name="resultSetMapper">The <see cref="IResultSetMapper<TResult>"/> that will be used to convert the returned set to an enumerable of clr type <typeparamref name="TResult"/>.</param> public Db2SprocAccessor(Db2Database database, string procedureName, IResultSetMapper <TResult> resultSetMapper) : this(database, procedureName, new DefaultParameterMapper(database), resultSetMapper) { }