/// <summary> /// Initializes a new instance of the <see cref="SqlConfiguration"/> class. /// </summary> /// <param name="connectionString">The connection string.</param> /// <param name="sprocNames">Name of the sproc.</param> /// <param name="mode">The mode.</param> public SqlConfiguration(string connectionString, ICollection<string> sprocNames, SprocMode mode = SprocMode.ExecuteNonQuery) { if (string.IsNullOrEmpty(connectionString)) { throw new ArgumentNullException("connectionString"); } if (sprocNames == null || !sprocNames.Any()) { throw new ArgumentNullException("sprocNames"); } ConnectionString = connectionString; StoredProcedures = sprocNames; Mode = mode; }
/// <summary> /// Initializes a new instance of the <see cref="SqlConfiguration"/> class. /// </summary> /// <param name="connectionString">The connection string.</param> /// <param name="sprocName">Name of the sproc.</param> /// <param name="mode">The mode.</param> public SqlConfiguration(string connectionString, string sprocName, SprocMode mode = SprocMode.ExecuteNonQuery) { if (string.IsNullOrEmpty(connectionString)) { throw new ArgumentNullException("connectionString"); } if (string.IsNullOrEmpty(sprocName)) { throw new ArgumentNullException("sprocName"); } ConnectionString = connectionString; StoredProcedures = new List<string> { sprocName }; Mode = mode; }