fix issue
This commit is contained in:
@@ -10,6 +10,7 @@ public class MigrationsTests : IDisposable
|
|||||||
{
|
{
|
||||||
private readonly ServiceProvider _serviceProvider;
|
private readonly ServiceProvider _serviceProvider;
|
||||||
private readonly ChatBotDbContext _dbContext;
|
private readonly ChatBotDbContext _dbContext;
|
||||||
|
private bool _disposed;
|
||||||
|
|
||||||
public MigrationsTests()
|
public MigrationsTests()
|
||||||
{
|
{
|
||||||
@@ -324,10 +325,25 @@ public class MigrationsTests : IDisposable
|
|||||||
remainingMessageCount.Should().Be(0);
|
remainingMessageCount.Should().Be(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Dispose()
|
protected virtual void Dispose(bool disposing)
|
||||||
|
{
|
||||||
|
if (_disposed)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (disposing)
|
||||||
{
|
{
|
||||||
_dbContext?.Dispose();
|
_dbContext?.Dispose();
|
||||||
_serviceProvider?.Dispose();
|
_serviceProvider?.Dispose();
|
||||||
|
}
|
||||||
|
|
||||||
|
_disposed = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Dispose()
|
||||||
|
{
|
||||||
|
Dispose(true);
|
||||||
GC.SuppressFinalize(this);
|
GC.SuppressFinalize(this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user