Przeglądaj źródła

Fix transaction scope disposed bug. #365

master
Savorboard 5 lat temu
rodzic
commit
1f09d9354d
1 zmienionych plików z 1 dodań i 15 usunięć
  1. +1
    -15
      src/DotNetCore.CAP/Abstractions/CapPublisherBase.cs

+ 1
- 15
src/DotNetCore.CAP/Abstractions/CapPublisherBase.cs Wyświetl plik

@@ -34,21 +34,7 @@ namespace DotNetCore.CAP.Abstractions

protected IServiceProvider ServiceProvider { get; }

public ICapTransaction Transaction
{
get
{
if (_transaction == null)
{
using (var scope = ServiceProvider.CreateScope())
{
_transaction = scope.ServiceProvider.GetRequiredService<CapTransactionBase>();
}
}

return _transaction;
}
}
public ICapTransaction Transaction => _transaction ?? (_transaction = ServiceProvider.GetRequiredService<CapTransactionBase>());

public void Publish<T>(string name, T contentObj, string callbackName = null)
{


Ładowanie…
Anuluj
Zapisz