Example #1
0
        private void SetPagingCommandFor(DbCommand command, MsSqlOutboxConfiguration configuration, int pageSize,
                                         int pageNumber)
        {
            var pagingSqlFormat = "SELECT * FROM (SELECT ROW_NUMBER() OVER(ORDER BY Timestamp DESC) AS NUMBER, * FROM {0}) AS TBL WHERE NUMBER BETWEEN ((@PageNumber-1)*@PageSize+1) AND (@PageNumber*@PageSize) ORDER BY Timestamp DESC";
            var parameters      = new[]
            {
                CreateSqlParameter("PageNumber", pageNumber),
                CreateSqlParameter("PageSize", pageSize)
            };

            var sql = string.Format(pagingSqlFormat, _configuration.OutBoxTableName);

            command.CommandText = sql;
            command.Parameters.AddRange(parameters);
        }
Example #2
0
 /// <summary>
 ///     Initializes a new instance of the <see cref="MsSqlOutbox" /> class.
 /// </summary>
 /// <param name="configuration">The configuration.</param>
 public MsSqlOutbox(MsSqlOutboxConfiguration configuration)
 {
     _configuration            = configuration;
     ContinueOnCapturedContext = false;
 }
Example #3
0
 /// <summary>
 ///     Initializes a new instance of the <see cref="MsSqlOutbox" /> class.
 /// </summary>
 /// <param name="configuration">The configuration.</param>
 public MsSqlOutbox(MsSqlOutboxConfiguration configuration) : this(configuration, new MsSqlOutboxSqlAuthConnectionFactory(configuration.ConnectionString))
 {
 }
Example #4
0
 /// <summary>
 ///     Initializes a new instance of the <see cref="MsSqlOutbox" /> class.
 /// </summary>
 /// <param name="configuration">The configuration.</param>
 /// <param name="connectionFactory">The connection factory.</param>
 public MsSqlOutbox(MsSqlOutboxConfiguration configuration, IMsSqlOutboxConnectionFactory connectionFactory)
 {
     _configuration            = configuration;
     ContinueOnCapturedContext = false;
     _connectionFactory        = connectionFactory;
 }