Пример #1
0
        /// <summary>
        /// Creates a new instance of <see cref="SprocAccessor&lt;TResult&gt;"/> 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&lt;TResult&gt;"/> that will be used to convert the returned set to an enumerable of clr type <typeparamref name="TResult"/>.</param>
        public OracleSprocAccessor(OracleDatabase 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("parameterMapper");
            }

            this.procedureName   = procedureName;
            this.parameterMapper = parameterMapper;
        }
Пример #2
0
 /// <summary>
 /// Creates a new instance of <see cref="SprocAccessor&lt;TResult&gt;"/> 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&lt;TResult&gt;"/> that will be used to convert the returned set to an enumerable of clr type <typeparamref name="TResult"/>.</param>
 public OracleSprocAccessor(OracleDatabase database, string procedureName, IResultSetMapper <TResult> resultSetMapper)
     : this(database, procedureName, new DefaultParameterMapper(database), resultSetMapper)
 {
 }