Browse Source

fixed sql query bug.

master
yangxiaodong 7 years ago
parent
commit
c9ac0108fe
1 changed files with 1 additions and 2 deletions
  1. +1
    -2
      src/DotNetCore.CAP.SqlServer/SqlServerStorageConnection.cs

+ 1
- 2
src/DotNetCore.CAP.SqlServer/SqlServerStorageConnection.cs View File

@@ -6,7 +6,6 @@ using System.Threading.Tasks;
using Dapper; using Dapper;
using DotNetCore.CAP.Infrastructure; using DotNetCore.CAP.Infrastructure;
using DotNetCore.CAP.Models; using DotNetCore.CAP.Models;
using Microsoft.EntityFrameworkCore;


namespace DotNetCore.CAP.SqlServer namespace DotNetCore.CAP.SqlServer
{ {
@@ -102,7 +101,7 @@ VALUES(@Name,@Group,@Content,@Retries,@Added,@ExpiresAt,@StatusName);";


public async Task<IEnumerable<CapReceivedMessage>> GetFailedReceviedMessages() public async Task<IEnumerable<CapReceivedMessage>> GetFailedReceviedMessages()
{ {
var sql = $"SELECT TOP (1) * FROM [{_options.Schema}].[Received] WITH (readpast) WHERE StatusName = '{StatusName.Failed}'";
var sql = $"SELECT * FROM [{_options.Schema}].[Received] WITH (readpast) WHERE StatusName = '{StatusName.Failed}'";
using (var connection = new SqlConnection(_options.ConnectionString)) using (var connection = new SqlConnection(_options.ConnectionString))
{ {
return await connection.QueryAsync<CapReceivedMessage>(sql); return await connection.QueryAsync<CapReceivedMessage>(sql);


Loading…
Cancel
Save