Exemplo n.º 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);
        }
Exemplo n.º 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;
 }
Exemplo n.º 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))
 {
 }
Exemplo n.º 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;
 }