Skip to content

Commit

Permalink
Try to fix IDisposable implementation on UnitOfWork
Browse files Browse the repository at this point in the history
  • Loading branch information
vanderlan committed Oct 5, 2023
1 parent 5f771ed commit ef9ac15
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions Orion.Data/UnitOfWork/UnitOfWork.cs
Original file line number Diff line number Diff line change
Expand Up @@ -67,19 +67,16 @@ public void DiscardChanges()
{
Dispose(false);
}

public void Dispose() => Dispose(true);

protected virtual void Dispose(bool disposing)
{
if (!_disposed)
if (!_disposed && disposing)
{
if (disposing)
{
DbContext.Dispose();
GC.SuppressFinalize(this);
}
DbContext.Dispose();
_disposed = true;
}
_disposed = true;
}
}
}

0 comments on commit ef9ac15

Please sign in to comment.