Skip to content

Commit c521599

Browse files
committed
Implementing dispose
1 parent 73ca9b8 commit c521599

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

src/Wax.Core/Repositories/IUnitOfWork.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
namespace Wax.Core.Repositories;
22

3-
public interface IUnitOfWork
3+
public interface IUnitOfWork : IDisposable
44
{
55
public ICustomerRepository Customers { get; }
66
Task SaveChangesAsync(CancellationToken cancellationToken = default);

src/Wax.Core/Repositories/UnitOfWork.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,9 @@ public Task SaveChangesAsync(CancellationToken cancellationToken = default)
2020
{
2121
return _context.SaveChangesAsync(cancellationToken);
2222
}
23+
24+
public void Dispose()
25+
{
26+
_context?.Dispose();
27+
}
2328
}

0 commit comments

Comments
 (0)