Sfoglia il codice sorgente

fixed callback topic send error bug.

undefined
Savorboard 7 anni fa
parent
commit
0ad6a92e20
3 ha cambiato i file con 9 aggiunte e 9 eliminazioni
  1. +2
    -2
      src/DotNetCore.CAP.MySql/CapPublisher.cs
  2. +3
    -3
      src/DotNetCore.CAP.PostgreSql/CapPublisher.cs
  3. +4
    -4
      src/DotNetCore.CAP.SqlServer/CapPublisher.cs

+ 2
- 2
src/DotNetCore.CAP.MySql/CapPublisher.cs Vedi File

@@ -30,11 +30,11 @@ namespace DotNetCore.CAP.MySql
_dbContext = (DbContext) ServiceProvider.GetService(_options.DbContextType);
}

public Task PublishAsync(CapPublishedMessage message)
public async Task PublishAsync(CapPublishedMessage message)
{
using (var conn = new MySqlConnection(_options.ConnectionString))
{
return conn.ExecuteAsync(PrepareSql(), message);
await conn.ExecuteAsync(PrepareSql(), message);
}
}



+ 3
- 3
src/DotNetCore.CAP.PostgreSql/CapPublisher.cs Vedi File

@@ -31,12 +31,12 @@ namespace DotNetCore.CAP.PostgreSql
_dbContext = (DbContext) ServiceProvider.GetService(_options.DbContextType);
}
}
public Task PublishAsync(CapPublishedMessage message)
public async Task PublishAsync(CapPublishedMessage message)
{
using (var conn = new NpgsqlConnection(_options.ConnectionString))
{
return conn.ExecuteAsync(PrepareSql(), message);
await conn.ExecuteAsync(PrepareSql(), message);
}
}



+ 4
- 4
src/DotNetCore.CAP.SqlServer/CapPublisher.cs Vedi File

@@ -28,14 +28,14 @@ namespace DotNetCore.CAP.SqlServer
if (_options.DbContextType == null) return;

IsUsingEF = true;
_dbContext = (DbContext) ServiceProvider.GetService(_options.DbContextType);
_dbContext = (DbContext)ServiceProvider.GetService(_options.DbContextType);
}

public Task PublishAsync(CapPublishedMessage message)
public async Task PublishAsync(CapPublishedMessage message)
{
using (var conn = new SqlConnection(_options.ConnectionString))
{
return conn.ExecuteAsync(PrepareSql(), message);
await conn.ExecuteAsync(PrepareSql(), message);
}
}

@@ -66,7 +66,7 @@ namespace DotNetCore.CAP.SqlServer
protected override Task ExecuteAsync(IDbConnection dbConnection, IDbTransaction dbTransaction,
CapPublishedMessage message)
{
dbConnection.ExecuteAsync(PrepareSql(), message, dbTransaction);
dbConnection.ExecuteAsync(PrepareSql(), message, dbTransaction);

_logger.LogInformation("Published Message has been persisted in the database. name:" + message);



Caricamento…
Annulla
Salva