Commit 0ad6a92e authored by Savorboard's avatar Savorboard

fixed callback topic send error bug.

parent c21f9705
...@@ -30,11 +30,11 @@ namespace DotNetCore.CAP.MySql ...@@ -30,11 +30,11 @@ namespace DotNetCore.CAP.MySql
_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 MySqlConnection(_options.ConnectionString)) using (var conn = new MySqlConnection(_options.ConnectionString))
{ {
return conn.ExecuteAsync(PrepareSql(), message); await conn.ExecuteAsync(PrepareSql(), message);
} }
} }
......
...@@ -32,11 +32,11 @@ namespace DotNetCore.CAP.PostgreSql ...@@ -32,11 +32,11 @@ namespace DotNetCore.CAP.PostgreSql
} }
} }
public Task PublishAsync(CapPublishedMessage message) public async Task PublishAsync(CapPublishedMessage message)
{ {
using (var conn = new NpgsqlConnection(_options.ConnectionString)) using (var conn = new NpgsqlConnection(_options.ConnectionString))
{ {
return conn.ExecuteAsync(PrepareSql(), message); await conn.ExecuteAsync(PrepareSql(), message);
} }
} }
......
...@@ -28,14 +28,14 @@ namespace DotNetCore.CAP.SqlServer ...@@ -28,14 +28,14 @@ namespace DotNetCore.CAP.SqlServer
if (_options.DbContextType == null) return; if (_options.DbContextType == null) return;
IsUsingEF = true; 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)) using (var conn = new SqlConnection(_options.ConnectionString))
{ {
return conn.ExecuteAsync(PrepareSql(), message); await conn.ExecuteAsync(PrepareSql(), message);
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment