mirror of
https://github.com/rjNemo/ticket_manager
synced 2026-06-06 08:46:39 +00:00
27 lines
No EOL
606 B
C#
27 lines
No EOL
606 B
C#
using System;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace TicketManager.Data
|
|
{
|
|
public class UnitOfWork : IUnitOfWork
|
|
{
|
|
private readonly AppDbContext _context;
|
|
public UnitOfWork(AppDbContext context)
|
|
{
|
|
_context = context;
|
|
Projects = new ProjectRepository(_context);
|
|
}
|
|
|
|
public IProjectRepository Projects { get; private set; }
|
|
|
|
public async Task<int> Complete()
|
|
{
|
|
return await _context.SaveChangesAsync();
|
|
}
|
|
|
|
public void Dispose()
|
|
{
|
|
_context.DisposeAsync();
|
|
}
|
|
}
|
|
} |