Skip to content

Commit

Permalink
Implementing dispose
Browse files Browse the repository at this point in the history
  • Loading branch information
linwenda committed Feb 2, 2023
1 parent 73ca9b8 commit c521599
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/Wax.Core/Repositories/IUnitOfWork.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
namespace Wax.Core.Repositories;

public interface IUnitOfWork
public interface IUnitOfWork : IDisposable
{
public ICustomerRepository Customers { get; }
Task SaveChangesAsync(CancellationToken cancellationToken = default);
Expand Down
5 changes: 5 additions & 0 deletions src/Wax.Core/Repositories/UnitOfWork.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,9 @@ public Task SaveChangesAsync(CancellationToken cancellationToken = default)
{
return _context.SaveChangesAsync(cancellationToken);
}

public void Dispose()
{
_context?.Dispose();
}
}

0 comments on commit c521599

Please sign in to comment.